aslakhellesoy-cucumber 0.2.2.1 → 0.2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +6 -1
- data/bin/cucumber +1 -1
- data/examples/i18n/Rakefile +6 -8
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ar/lib/calculator.rb +1 -0
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ko/features/addition.feature +1 -1
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/no/features/support/env.rb +1 -1
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ru/features/support/env.rb +1 -1
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +1 -1
- data/features/cucumber_cli_outlines.feature +1 -1
- data/lib/cucumber/ast/outline_table.rb +1 -1
- data/lib/cucumber/ast/table.rb +21 -0
- data/lib/cucumber/formatter/ansicolor.rb +10 -2
- data/lib/cucumber/languages.yml +1 -1
- data/lib/cucumber/step_mother.rb +3 -2
- data/lib/cucumber/version.rb +1 -1
- data/rails_generators/cucumber/templates/env.rb +1 -1
- data/rails_generators/cucumber/templates/webrat_steps.rb +8 -0
- data/spec/cucumber/ast/table_spec.rb +21 -0
- data/spec/cucumber/step_mother_spec.rb +17 -1
- metadata +2 -3
- data/lib/cucumber/formatters/unicode.rb +0 -2
data/History.txt
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
== 0.2.3 (In Git)
|
2
2
|
|
3
3
|
=== New features
|
4
|
+
* Added new Then /^I should be on (.+)$/ do |page_name| step (Grant Hollingworth)
|
5
|
+
* Use skipped_param color for examples table header (#266 Eugene Naydanov)
|
6
|
+
* Added new Cucumber::Ast::Table#rows_hash method (Torbjørn Vatn)
|
7
|
+
* Windows/JRuby users can now enjoy colourful output (via http://aslakhellesoy.github.com/ansicolor) (Aslak Hellesøy)
|
8
|
+
* Ambiguous step errors hint about --guess (unless --guess already on) (Aslak Hellesøy)
|
4
9
|
* Updated language for Dutch (Bart Zonneveld)
|
5
10
|
* Updated language for Italian (Alessandro Baroni)
|
6
11
|
* Updated language for Japanese (KAKUTANI Shintaro)
|
@@ -72,7 +77,7 @@ for multiline arguments are some of the highlights.
|
|
72
77
|
* Can't use an empty string as a table value in a scenario outline (#172 Aslak Hellesøy)
|
73
78
|
* Really skip skipped steps (#90 Aslak Hellesøy)
|
74
79
|
* No output for multi-line strings (#71 Aslak Hellesøy)
|
75
|
-
* Fix cucumber/
|
80
|
+
* Fix cucumber/formatter/unicode flaws on Windows (#145 Michael)
|
76
81
|
* Autotest-related Bugs: YAML missing (#136 Tobias Pape)
|
77
82
|
* Overeager "rescue LoadError" hides lots of errors (#137 Jonathan del Strother)
|
78
83
|
* Nested steps don't show mismatch (#116 Aslak Hellesøy)
|
data/bin/cucumber
CHANGED
@@ -3,4 +3,4 @@
|
|
3
3
|
$:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
|
4
4
|
|
5
5
|
require 'cucumber/cli/main'
|
6
|
-
Cucumber::Cli::Main.execute(ARGV.dup)
|
6
|
+
Cucumber::Cli::Main.execute(ARGV.dup) # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
|
data/examples/i18n/Rakefile
CHANGED
@@ -4,14 +4,16 @@ task :i18n do
|
|
4
4
|
Dir["#{dir}/*"].each do |f|
|
5
5
|
if File.directory?(f)
|
6
6
|
lang = f[dir.length+1..-1]
|
7
|
-
if
|
7
|
+
if examples_working?(lang)
|
8
8
|
Dir.chdir(f) do
|
9
9
|
rake("features")
|
10
10
|
end
|
11
11
|
else
|
12
12
|
STDERR.puts %{
|
13
13
|
!!!!!
|
14
|
-
!!!!!
|
14
|
+
!!!!!
|
15
|
+
!!!!! SKIPPING #{lang} (The examples are out of date - please help update them)
|
16
|
+
!!!!!
|
15
17
|
!!!!!
|
16
18
|
}
|
17
19
|
end
|
@@ -19,12 +21,8 @@ task :i18n do
|
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
22
|
-
def
|
23
|
-
|
24
|
-
!%w{ar ko zh-CN}.index(lang)
|
25
|
-
else
|
26
|
-
!%w{ar ko}.index(lang)
|
27
|
-
end
|
24
|
+
def examples_working?(lang)
|
25
|
+
!%w{ro ko li lt}.index(lang)
|
28
26
|
end
|
29
27
|
|
30
28
|
def rake(args)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'spec/expectations'
|
3
3
|
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
-
require 'cucumber/
|
4
|
+
require 'cucumber/formatter/unicode'
|
5
5
|
require 'calculatrice'
|
6
6
|
|
7
7
|
Soit /^une calculatrice$/ do
|
data/lib/cucumber/ast/table.rb
CHANGED
@@ -60,6 +60,23 @@ module Cucumber
|
|
60
60
|
row.to_hash
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
# Converts this table into a Hash where the first column is
|
65
|
+
# used as keys and the second column is used as values
|
66
|
+
#
|
67
|
+
# | a | 2 |
|
68
|
+
# | b | 3 |
|
69
|
+
#
|
70
|
+
# Gets converted into the following:
|
71
|
+
#
|
72
|
+
# {'a' => '2', 'b' => '3'}
|
73
|
+
#
|
74
|
+
# The table must be exactly two columns wide
|
75
|
+
#
|
76
|
+
def rows_hash
|
77
|
+
verify_table_width(2)
|
78
|
+
@rows_hash = self.transpose.hashes[0]
|
79
|
+
end
|
63
80
|
|
64
81
|
# Gets the raw data of this table. For example, a Table built from
|
65
82
|
# the following plain text:
|
@@ -160,6 +177,10 @@ module Cucumber
|
|
160
177
|
def verify_column(column_name)
|
161
178
|
raise %{The column named "#{column_name}" does not exist} unless @raw[0].include?(column_name)
|
162
179
|
end
|
180
|
+
|
181
|
+
def verify_table_width(width)
|
182
|
+
raise %{The table must have exactly #{width} columns} unless @raw[0].size == width
|
183
|
+
end
|
163
184
|
|
164
185
|
def arguments_replaced(arguments) #:nodoc:
|
165
186
|
raw_with_replaced_args = raw.map do |row|
|
@@ -6,12 +6,20 @@ if Cucumber::WINDOWS_MRI
|
|
6
6
|
gem 'win32console', '>= 1.2.0'
|
7
7
|
require 'Win32/Console/ANSI'
|
8
8
|
rescue LoadError
|
9
|
-
STDERR.puts
|
9
|
+
STDERR.puts %{*** WARNING: You must "gem install win32console" (1.2.0 or higher) to get coloured output on MRI/Windows}
|
10
|
+
Term::ANSIColor.coloring = false
|
11
|
+
end
|
12
|
+
elsif Cucumber::WINDOWS && Cucumber::JRUBY
|
13
|
+
begin
|
14
|
+
gem 'aslakhellesoy-ansicolor', '>= 1.0'
|
15
|
+
require 'ansicolor'
|
16
|
+
rescue LoadError
|
17
|
+
STDERR.puts %{*** WARNING: You must "gem install aslakhellesoy-ansicolor --source http://gems.github.com" (1.0 or higher) to get coloured output on JRuby/Windows}
|
10
18
|
Term::ANSIColor.coloring = false
|
11
19
|
end
|
12
20
|
end
|
13
21
|
|
14
|
-
Term::ANSIColor.coloring = false if !STDOUT.tty?
|
22
|
+
Term::ANSIColor.coloring = false if !STDOUT.tty?
|
15
23
|
|
16
24
|
module Cucumber
|
17
25
|
module Formatter
|
data/lib/cucumber/languages.yml
CHANGED
@@ -198,6 +198,7 @@
|
|
198
198
|
native: Bahasa Indonesia
|
199
199
|
encoding: UTF-8
|
200
200
|
feature: Fitur
|
201
|
+
background: Dasar
|
201
202
|
scenario: Skenario
|
202
203
|
scenario_outline: Skenario konsep
|
203
204
|
examples: Contoh
|
@@ -386,7 +387,6 @@
|
|
386
387
|
scenario: 시나리오
|
387
388
|
scenario_outline: 시나리오 개요
|
388
389
|
examples: 예
|
389
|
-
more_examples: 다른 예
|
390
390
|
given: 조건
|
391
391
|
when: 만일
|
392
392
|
then: 그러면
|
data/lib/cucumber/step_mother.rb
CHANGED
@@ -26,10 +26,11 @@ module Cucumber
|
|
26
26
|
|
27
27
|
# Raised when a step matches 2 or more StepDefinition
|
28
28
|
class Ambiguous < StandardError
|
29
|
-
def initialize(step_name, step_definitions)
|
29
|
+
def initialize(step_name, step_definitions, used_guess)
|
30
30
|
message = "Ambiguous match of \"#{step_name}\":\n\n"
|
31
31
|
message << step_definitions.map{|sd| sd.backtrace_line}.join("\n")
|
32
32
|
message << "\n\n"
|
33
|
+
message << "You can run again with --guess to make Cucumber be more smart about it\n" unless used_guess
|
33
34
|
super(message)
|
34
35
|
end
|
35
36
|
end
|
@@ -118,7 +119,7 @@ module Cucumber
|
|
118
119
|
matches = step_definitions.map { |d| d.step_match(step_name, formatted_step_name) }.compact
|
119
120
|
raise Undefined.new(step_name) if matches.empty?
|
120
121
|
matches = best_matches(step_name, matches) if matches.size > 1 && options[:guess]
|
121
|
-
raise Ambiguous.new(step_name, matches) if matches.size > 1
|
122
|
+
raise Ambiguous.new(step_name, matches, options[:guess]) if matches.size > 1
|
122
123
|
matches[0]
|
123
124
|
end
|
124
125
|
|
data/lib/cucumber/version.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
ENV["RAILS_ENV"] ||= "test"
|
3
3
|
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
4
4
|
require 'cucumber/rails/world'
|
5
|
-
require 'cucumber/
|
5
|
+
require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
|
6
6
|
Cucumber::Rails.use_transactional_fixtures
|
7
7
|
Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
|
8
8
|
# (e.g. rescue_action_in_public / rescue_responses / rescue_from)
|
@@ -113,3 +113,11 @@ Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
|
|
113
113
|
assert field_labeled(label).checked?
|
114
114
|
<% end -%>
|
115
115
|
end
|
116
|
+
|
117
|
+
Then /^I should be on (.+)$/ do |page_name|
|
118
|
+
<% if framework == :rspec -%>
|
119
|
+
URI.parse(current_url).path.should == path_to(page_name)
|
120
|
+
<% else -%>
|
121
|
+
assert_equal path_to(page_name), URI.parse(current_url).path
|
122
|
+
<% end -%>
|
123
|
+
end
|
@@ -69,6 +69,27 @@ module Cucumber
|
|
69
69
|
@table.transpose.hashes[0].should == {'one' => '1111', 'two' => '22222'}
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
describe ".rows_hash" do
|
74
|
+
|
75
|
+
it "should return a hash of the rows" do
|
76
|
+
table = Table.new([
|
77
|
+
%w{one 1111},
|
78
|
+
%w{two 22222}
|
79
|
+
])
|
80
|
+
table.rows_hash.should == {'one' => '1111', 'two' => '22222'}
|
81
|
+
end
|
82
|
+
|
83
|
+
it "should fail if the table doesn't have two columns" do
|
84
|
+
faulty_table = Table.new([
|
85
|
+
%w{one 1111 abc},
|
86
|
+
%w{two 22222 def}
|
87
|
+
])
|
88
|
+
lambda {
|
89
|
+
faulty_table.rows_hash
|
90
|
+
}.should raise_error('The table must have exactly 2 columns')
|
91
|
+
end
|
92
|
+
end
|
72
93
|
|
73
94
|
it "should allow renaming columns" do
|
74
95
|
table2 = @table.map_headers('one' => :three)
|
@@ -19,7 +19,7 @@ module Cucumber
|
|
19
19
|
format.should == "it [snows] in [april]"
|
20
20
|
end
|
21
21
|
|
22
|
-
it "should raise Ambiguous error when multiple step definitions match" do
|
22
|
+
it "should raise Ambiguous error with guess hint when multiple step definitions match" do
|
23
23
|
@step_mother.Given(/Three (.*) mice/) {|disability|}
|
24
24
|
@step_mother.Given(/Three blind (.*)/) {|animal|}
|
25
25
|
|
@@ -30,6 +30,22 @@ module Cucumber
|
|
30
30
|
spec/cucumber/step_mother_spec.rb:23:in `/Three (.*) mice/'
|
31
31
|
spec/cucumber/step_mother_spec.rb:24:in `/Three blind (.*)/'
|
32
32
|
|
33
|
+
You can run again with --guess to make Cucumber be more smart about it
|
34
|
+
})
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should not show --guess hint when --guess is used" do
|
38
|
+
@step_mother.options = {:guess => true}
|
39
|
+
@step_mother.Given(/Three (.*) mice/) {|disability|}
|
40
|
+
@step_mother.Given(/Three cute (.*)/) {|animal|}
|
41
|
+
|
42
|
+
lambda do
|
43
|
+
@step_mother.step_match("Three cute mice")
|
44
|
+
end.should raise_error(Ambiguous, %{Ambiguous match of "Three cute mice":
|
45
|
+
|
46
|
+
spec/cucumber/step_mother_spec.rb:39:in `/Three (.*) mice/'
|
47
|
+
spec/cucumber/step_mother_spec.rb:40:in `/Three cute (.*)/'
|
48
|
+
|
33
49
|
})
|
34
50
|
end
|
35
51
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aslakhellesoy-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.2.
|
4
|
+
version: 0.2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Aslak Helles\xC3\xB8y"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-28 00:00:00 -07:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -333,7 +333,6 @@ files:
|
|
333
333
|
- lib/cucumber/formatter/rerun.rb
|
334
334
|
- lib/cucumber/formatter/unicode.rb
|
335
335
|
- lib/cucumber/formatter/usage.rb
|
336
|
-
- lib/cucumber/formatters/unicode.rb
|
337
336
|
- lib/cucumber/languages.yml
|
338
337
|
- lib/cucumber/parser.rb
|
339
338
|
- lib/cucumber/parser/basic.rb
|