Skip to content

Instantly share code, notes, and snippets.

@heathd
Last active August 29, 2015 14:02
Show Gist options
  • Save heathd/ca7cdca66e4545c952a0 to your computer and use it in GitHub Desktop.
Save heathd/ca7cdca66e4545c952a0 to your computer and use it in GitHub Desktop.
Ruby2Ruby destroys its input
source 'http://rubygems.org'
gem 'ruby2ruby'
gem 'rspec'
~/ca7cdca66e4545c952a0(master)$ be rspec ruby2ruby_should_not_destroy_its_input_spec.rb
F
Failures:
1) Ruby2Ruby is non-destructive
Failure/Error: expect(sexp).to eq(s(:call, s(:call, nil, :a), :b))
expected: s(:call, s(:call, nil, :a), :b)
got: s()
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-[:call, [:call, nil, :a], :b]
+[]
# ./ruby2ruby_should_not_destroy_its_input_spec.rb:8:in `block (2 levels) in <top (required)>'
Finished in 0.00212 seconds (files took 0.0897 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./ruby2ruby_should_not_destroy_its_input_spec.rb:4 # Ruby2Ruby is non-destructive
require 'ruby2ruby'
describe "Ruby2Ruby" do
it "is non-destructive" do
sexp = s(:call, s(:call, nil, :a), :b)
Ruby2Ruby.new.process(sexp)
expect(sexp).to eq(s(:call, s(:call, nil, :a), :b))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment