spec/code/parser/string_spec.rb in code-ruby-0.4.0 vs spec/code/parser/string_spec.rb in code-ruby-0.5.0
- old
+ new
@@ -1,29 +1,21 @@
require "spec_helper"
RSpec.describe Code::Parser::String do
- subject { described_class.new.parse(input) }
+ subject { Code::Parser.parse(input) }
[
- "'hello'",
- '"hello"',
"''",
'""',
- "'\\''",
- '"\\t"',
- "'\\r'",
- '"\\b\\f\\n\\r\\t"',
- '"\\uABCG"',
- "'\\u0123\\u4567\\u89aA\\ubBcC\\UdDeE\\ufFfF'",
- ":asc",
- "'1 + 1 = {1 + 1}'",
- "'a + b = {'{'a'}{'b'}'}'",
+ "'Hello Dorian'",
+ '"Hello Dorian"',
+ "'Hello \\{name}'",
+ '"Hello \\{name}"',
+ "'Hello {name}'",
+ '"Hello {name}"'
].each do |input|
- context input.inspect do
+ context input do
let(:input) { input }
-
- it "succeeds" do
- expect { subject }.to_not raise_error
- end
+ it { subject }
end
end
end