Skip to content

Commit

Permalink
add scenario outline to Norwegian fixture to beef up the test a littl…
Browse files Browse the repository at this point in the history
…e; add test for language line/iso-code pattern
  • Loading branch information
twcamper committed Jul 4, 2011
1 parent 29ddc01 commit 537e80e
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions spec/cuporter/functional/i18n_spec.rb
Expand Up @@ -5,6 +5,15 @@ module Cuporter
let(:file) {"file.feature"}
let(:doc) {Cuporter::Document.new_xml}

context "installed gherkin" do
it "language line pattern matches all iso codes from gherkin" do
require 'gherkin/i18n'
installed_iso_codes = Gherkin::I18n::LANGUAGES.keys
installed_iso_codes.each do |iso_code|
Cuporter::FeatureParser::Language::LANGUAGE_LINE.should =~ "# language: #{iso_code}"
end
end
end
context "Specify an iso-code in a language header" do

context "en" do
Expand All @@ -25,12 +34,7 @@ module Cuporter
end
it "does not raise an error" do
expect do
begin
feature = FeatureParser.node(file, doc, Filter.new, '.')
rescue Exception => ex
puts ex.backtrace
raise ex
end
FeatureParser.node(file, doc, Filter.new, '.')
end.to_not raise_error
end
end
Expand All @@ -42,8 +46,22 @@ module Cuporter
report.should == <<EOF
@i18n
Egenskap: Summering
Abstrakt Scenario: eep oop ap
Eksempler: wee wee wee
| oop | nerf |
| nnn | mmm |
| lok | frey |
| drf | mmm |
Scenario: to tall
Scenario: tre tall
@troll
Egenskap: Summering
Abstrakt Scenario: eep oop ap
Eksempler: wee wee wee
| oop | nerf |
| nnn | mmm |
| lok | frey |
| drf | mmm |
@wip
Egenskap: Summering
Scenario: tre tall
Expand Down

0 comments on commit 537e80e

Please sign in to comment.