Sha256: 8535e6c613e7654deb7631923e5e3689a5fe39b60248b2e65bcf367bed31c298

Contents?: true

Size: 1.07 KB

Versions: 17

Compression:

Stored size: 1.07 KB

Contents

Given /^the(?: following)? locale:?$/ do |string|
  @csl = CSL::Locale.load(string)
end

When /^I load the locale from the string$/ do |string|
  @csl = CSL::Locale.load(string)
end

When /^I ordinalize the number (\d+)(?: using the (long) form(?: and (feminine|masculine) gender))?$/ do |num, form, gender|
  @ordinal = @locale.ordinalize(num, :form => form, :'gender-form' => gender)
end

Then /^the ordinal should (?:be|equal) "([^"]*)"$/ do |ord|
  @ordinal.should == ord
end

When /^I ordinalize these numbers:?$/ do |table|
  @ordinals = table.rows.map do |row|
    num, form, gender, number = *row
    @csl.ordinalize(num, :form => form, :'gender-form' => gender, :number => number)
  end
end

Then /^the ordinals should (?:be|equal):?$/ do |table|
  @ordinals.join(' ').should == table.rows.flatten.join(' ')
end

Then /^the locale should should have (\d+) terms$/ do |num|
	@csl.terms.length.should == num.to_i
end

Then /^the (\w+[\?!]?) of the term "([^"]*)" should be "([^"]*)"$/ do |method, name, expected|
	@csl.terms.detect { |t| t.name == name }.send(method).should == expected
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
csl-1.2.1 features/step_definitions/locale_steps.rb
csl-1.2.0 features/step_definitions/locale_steps.rb
csl-1.1.0 features/step_definitions/locale_steps.rb
csl-1.0.2 features/step_definitions/locale_steps.rb
csl-1.0.1 features/step_definitions/locale_steps.rb
csl-1.0.0 features/step_definitions/locale_steps.rb
csl-1.0.0.pre23 features/step_definitions/locale_steps.rb
csl-1.0.0.pre22 features/step_definitions/locale_steps.rb
csl-1.0.0.pre21 features/step_definitions/locale_steps.rb
csl-1.0.0.pre20 features/step_definitions/locale_steps.rb
csl-1.0.0.pre19 features/step_definitions/locale_steps.rb
csl-1.0.0.pre18 features/step_definitions/locale_steps.rb
csl-1.0.0.pre17 features/step_definitions/locale_steps.rb
csl-1.0.0.pre16 features/step_definitions/locale_steps.rb
csl-1.0.0.pre15 features/step_definitions/locale_steps.rb
csl-1.0.0.pre14 features/step_definitions/locale_steps.rb
csl-1.0.0.pre13 features/step_definitions/locale_steps.rb