Sha256: d34737cb8245cdbc136e0f8c83a2d5f0f146b57afcde67d9cd0fe2dd25566166

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 KB

Contents

# encoding: utf-8

Given(/^the input string is "(.*?)"$/) do |str|
  @content = str
end

Given(/^the input string is$/) do |str|
  @content = str
end

When(/^input string is processed with Typogrowl’s typography parser$/) do
  @content.gsub! /\\+"/, '"'
  @typo = Typogrowth.parse @content
end

When(/^input string is processed with Typogrowl’s typography parser with lang "(.*?)"$/) do |lang|
  @content.gsub! /\\+"/, '"'
  @typo = Typogrowth.parse @content, lang: lang
end

When(/^input string is processed with Typogrowl’s typography parser with section "(.*?)"$/) do |sect|
  @content.gsub! /\\+"/, '"'
  @typo = @content.typo sections: sect.to_sym
end

When(/^input string is modified inplace with typo!$/) do
  @typoed = @content.dup
  @typoed.typo!
end

When(/^input string language is determined$/) do
  @lang = @content.is_ru? ? "ru" : "us"
end

Then(/^neither single nor double quotes are left in the string$/) do
  @typo.scan(/"|'/).count.should == 0
end

Then(/^the typoed result should equal to "(.*?)"$/) do |str|
  @typo.should == str
end

Then(/^the typoed result should equal to$/) do |str|
  @typo.should == str
end

Then(/^the call to string’s typo should equal to "(.*?)"$/) do |str|
  @content.typo.should == str
end

Then(/^the call to string’s typo with lang "(.*?)" should equal to "(.*?)"$/) do |lang, str|
  @content.typo(lang: 'ru').should == str
end

Then(/^typoed result should equal to "(.*?)"$/) do |str|
  @typoed.should == str
end

Then(/^the language should equal to "(.*?)"$/) do |lang|
  @lang.should == lang
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typogrowth-0.9.8 features/step_definitions/typogrowth_steps.rb