Sha256: 25ea2b9e49cb7937a62db3bb18f2eb28c9959f1a674bb426191e3f11ba4d651c

Contents?: true

Size: 773 Bytes

Versions: 71

Compression:

Stored size: 773 Bytes

Contents

# encoding: iso-8859-1
# Ideally we would use Norwegian keywords here, but that won't work unless this file is UTF-8 encoded.
# Alternatively it would be possible to use Norwegian keywords and encode the file as UTF-8.
# 
# In both cases, stepdef arguments will be sent in as UTF-8, regardless of what encoding is used.
Given /^jeg drikker en "([^"]*)"$/ do |drink|
  drink.should == utf8('øl', 'iso-8859-1')
end

When /^skal de andre si "([^"]*)"$/ do |greeting|
  greeting.should == utf8('skål', 'iso-8859-1')
end

module EncodingHelper
  def utf8(string, encoding)
    if string.respond_to?(:encode) # Ruby 1.9
      string.encode('UTF-8')
    else # Ruby 1.8
      require 'iconv'
      Iconv.new('UTF-8', encoding).iconv(string)
    end
  end
end
World(EncodingHelper)

Version data entries

71 entries across 67 versions & 10 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/features/step_definitions/iso-8859-1_steps.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/features/step_definitions/iso-8859-1_steps.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.20 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.19 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.18 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.17 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.16 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.15 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.14 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.13 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.12 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.11 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.10 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.9 features/step_definitions/iso-8859-1_steps.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/features/step_definitions/iso-8859-1_steps.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/features/step_definitions/iso-8859-1_steps.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.8 features/step_definitions/iso-8859-1_steps.rb
cucumber-1.3.7 features/step_definitions/iso-8859-1_steps.rb