Sha256: e5e1d06853f19f63e42dd59fa5b3385fa2f282d15921a80bfff6fbcd767054f6

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

When /^I parse the CSL string(?: in the (\w+) scope)?$/ do |scope, string|
  @csl = CSL.parse string, CSL.const_get(scope || 'Node')
end

Then /^(?:the )?(\w+[\?!]?) should be "([^"]*)"$/ do |name, expected|
  actual = @csl.send(name)
  actual = !!actual if expected =~ /^true|false$/
  actual.to_s.should == expected
end

Then /^the (\w+) (\w+) should be "([^"]*)"$/ do |outer, inner, expected|
  @csl.send(outer).send(inner).to_s.should == expected
end

Then /^the attribute "([^"]*)" should be "([^"]*)"$/ do |name, expected|
  @csl[name.to_sym].should == expected
end

Then /^the node should have (\d+) (\w+)$/ do |length, name|
  @csl.send(name).length.should == length.to_i
end

Then /^the (\w+) number (\d+) should have the attribute "([^"]*)" set to "([^"]*)"$/ do |name, offset, attribute, expected|
  @csl.send("#{name}s")[offset.to_i - 1][attribute.to_sym].should == expected
end

Then /^the (\w+) number (\d+) should( not)? be a (\w+)$/ do |name, offset, negate, predicate|
  @csl.send("#{name}s")[offset.to_i - 1].send("#{predicate}?").should == negate.nil?
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
csl-1.0.2 features/step_definitions/parser_steps.rb
csl-1.0.1 features/step_definitions/parser_steps.rb
csl-1.0.0 features/step_definitions/parser_steps.rb
csl-1.0.0.pre23 features/step_definitions/parser_steps.rb
csl-1.0.0.pre22 features/step_definitions/parser_steps.rb