spec/code_spec.rb in template-ruby-0.2.4 vs spec/code_spec.rb in template-ruby-0.3.0
- old
+ new
@@ -94,9 +94,21 @@
["a = 0\n until a > 10 a += 1 end a", "11"],
["until true end", ""],
["until true\nend", ""],
%w[("Good".."Bad").first Good],
['"Dorian " * 2', "Dorian Dorian "],
+ ["while false end == nothing", "true"],
+ ['"1 + 1 = {1 + 1}"', "1 + 1 = 2"],
+ ["'1 + 1 = {1 + 1}'", "1 + 1 = 2"],
+ ["{}.to_string + [].to_string", "{}[]"],
+ ["'a' + 1", "a1"],
+ ["'a' + 1.0", "a1.0"],
+ ["1 + 'a'", "1a"],
+ ["1.0 + 'a'", "1.0a"],
+ ["1 << 1", "2"],
+ ["1.0 << 1", "2"],
+ ["1 << 1.0", "2"],
+ ["1.0 << 1.0", "2"],
].each do |(input, expected)|
context input.inspect do
let(:input) { input }
it "succeeds" do