~ubuntu-branches/ubuntu/wily/cucumber/wily-proposed

« back to all changes in this revision

Viewing changes to features/step_definitions/iso-8859-1_steps.rb

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier, Antonio Terceiro, Cédric Boutillier
  • Date: 2015-06-20 16:52:32 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150620165232-hznc8mxma08er27p
Tags: 2.0.0-1
[ Antonio Terceiro ]
* debian/cucumber.pod: fix typo in manpage (Closes: #767215)

[ Cédric Boutillier ]
* Imported Upstream version 2.0.0
* rename the file in debian/missing-source to remove -min suffix, and make
  lintian happy
* reproducibility: use last changelog date to build the manpage
* update 0004-Update_default_binary_path.patch
* drop 0001-Remove-rubygems-bundler-stuff-from-spec_helper.patch, not needed
  anymore
* build-depend on pry
* depend on ruby-cucumber-core

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# encoding: iso-8859-1
2
 
# Ideally we would use Norwegian keywords here, but that won't work unless this file is UTF-8 encoded.
3
 
# Alternatively it would be possible to use Norwegian keywords and encode the file as UTF-8.
4
 
5
 
# In both cases, stepdef arguments will be sent in as UTF-8, regardless of what encoding is used.
6
 
Given /^jeg drikker en "([^"]*)"$/ do |drink|
7
 
  drink.should == utf8('�l', 'iso-8859-1')
8
 
end
9
 
 
10
 
When /^skal de andre si "([^"]*)"$/ do |greeting|
11
 
  greeting.should == utf8('sk�l', 'iso-8859-1')
12
 
end
13
 
 
14
 
module EncodingHelper
15
 
  def utf8(string, encoding)
16
 
    if string.respond_to?(:encode) # Ruby 1.9
17
 
      string.encode('UTF-8')
18
 
    else # Ruby 1.8
19
 
      require 'iconv'
20
 
      Iconv.new('UTF-8', encoding).iconv(string)
21
 
    end
22
 
  end
23
 
end
24
 
World(EncodingHelper)
 
 
b'\\ No newline at end of file'