spec/code/parser/dictionnary_spec.rb in template-ruby-0.2.4 vs spec/code/parser/dictionnary_spec.rb in template-ruby-0.3.0
- old
+ new
@@ -2,45 +2,18 @@
RSpec.describe Code::Parser::Dictionnary do
subject { described_class.new.parse(input) }
[
- [
- '{name: "Dorian"}',
- {
- dictionnary: [{ key: { name: "name" }, value: [{ string: "Dorian" }] }],
- },
- ],
- [
- '{a: true, "b": false}',
- {
- dictionnary: [
- { key: { name: "a" }, value: [{ boolean: "true" }] },
- { key: { string: "b" }, value: [{ boolean: "false" }] },
- ],
- },
- ],
- [
- "{ true => 1, false => 2}",
- {
- dictionnary: [
- {
- key: [{ boolean: "true" }],
- value: [{ number: { base_10: { integer: { whole: "1" } } } }],
- },
- {
- key: [{ boolean: "false" }],
- value: [{ number: { base_10: { integer: { whole: "2" } } } }],
- },
- ],
- },
- ],
- ].each do |(input, expected)|
+ '{name: "Dorian"}',
+ '{a: true, "b": false}',
+ "{ true => 1, false => 2}",
+ ].each do |input|
context input.inspect do
let(:input) { input }
it "succeeds" do
- expect(subject).to eq(expected)
+ expect { subject }.to_not raise_error
end
end
end
end