Skip to content

added a test to break out of proc #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ rvm:

before_install:
- gem update --system "3.1.2"
script: bundle exec rake compile
script: bundle exec rake spec
13 changes: 13 additions & 0 deletions spec/script_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@
],
timeout: 1000,
)
expect(result.errors).to eq([])
expect(result.success?).to be(true)
expect(result.output).to eq([26803196617, 0.475])
expect(result.stdout).to eq("hello")
end

it "breaks out of a proc just fine" do
result = EnterpriseScriptService.run(
input: {},
sources: [
["proc", "[1, 2].each { |i| break }"],
],
timeout: 1000,
)
expect(result.errors).to eq([])
expect(result.success?).to be(true)
end

it "round trips binary strings" do
result = EnterpriseScriptService.run(
input: "hello".force_encoding(Encoding::BINARY),
Expand Down