spec/rley/parser/chart_spec.rb in rley-0.2.11 vs spec/rley/parser/chart_spec.rb in rley-0.2.12
- old
+ new
@@ -24,17 +24,17 @@
literals = %w(I saw John with a dog)
literals.map { |lexeme| Token.new(lexeme, nil) }
end
let(:sample_tracer) { ParseTracer.new(0, output, token_seq) }
+
+ # Default instantiation rule
+ subject { Chart.new([ dotted_rule ], count_token, sample_tracer) }
context 'Initialization:' do
- # Default instantiation rule
- subject { Chart.new(dotted_rule, count_token, sample_tracer) }
-
it 'should be created with start dotted rule, token count, tracer' do
- expect { Chart.new(dotted_rule, count_token, sample_tracer) }
+ expect { Chart.new([ dotted_rule ], count_token, sample_tracer) }
.not_to raise_error
end
it 'should have a seed state in first state_set' do
seed_state = ParseState.new(dotted_rule, 0)
@@ -80,10 +80,9 @@
# Factory method.
def parse_state(origin, aDottedRule)
ParseState.new(aDottedRule, origin)
end
- subject { Chart.new(dotted_rule, count_token, sample_tracer) }
it 'should trace its initialization' do
subject[0] # Force constructor call here
expectation = <<-SNIPPET
['I', 'saw', 'John', 'with', 'a', 'dog']