aslakhellesoy-cucumber 0.1.13.3 → 0.1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -1
- data/Manifest.txt +6 -1
- data/config/hoe.rb +1 -0
- data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/cs/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/Rakefile +18 -2
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +2 -1
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +2 -1
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +2 -1
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +2 -1
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +2 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +2 -1
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +2 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +2 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/java/features/step_definitons/hello_steps.rb +1 -1
- data/examples/java/features/step_definitons/tree_steps.rb +1 -1
- data/examples/selenium/features/step_definitons/stories_steps.rb +1 -1
- data/examples/tickets/features/step_definitons/tickets_steps.rb +1 -1
- data/examples/watir/README.textile +16 -0
- data/examples/watir/features/support/env.rb +1 -1
- data/gem_tasks/rspec.rake +2 -2
- data/gem_tasks/treetop.rake +1 -1
- data/lib/autotest/cucumber_mixin.rb +1 -1
- data/lib/cucumber/cli.rb +2 -1
- data/lib/cucumber/core_ext/string.rb +1 -1
- data/lib/cucumber/formatters/ansicolor.rb +1 -1
- data/lib/cucumber/formatters/pretty_formatter.rb +11 -6
- data/lib/cucumber/formatters/unicode.rb +1 -1
- data/lib/cucumber/languages.yml +11 -0
- data/lib/cucumber/platform.rb +2 -1
- data/lib/cucumber/rails/rspec.rb +1 -1
- data/lib/cucumber/treetop_parser/feature.treetop.erb +1 -0
- data/lib/cucumber/treetop_parser/feature_ar.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_cy.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_da.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_de.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en-tx.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_es.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_et.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_fr.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_id.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_it.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ja.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_lt.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_nl.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_no.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_parser.rb +3 -1
- data/lib/cucumber/treetop_parser/feature_pl.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_pt.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ro.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ro2.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ru.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_se.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_zh-CN.rb +1 -0
- data/lib/cucumber/version.rb +2 -2
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +34 -3
- data/spec/spec_helper.rb +1 -1
- metadata +3 -3
- data/examples/java/src/cucumber/demo/Hello.java +0 -16
data/History.txt
CHANGED
@@ -1,14 +1,24 @@
|
|
1
1
|
== In Git
|
2
2
|
|
3
|
+
=== New features
|
4
|
+
* 한국어! (Korean!) (John Hwang)
|
5
|
+
|
6
|
+
== 0.1.14 2009-01-04
|
7
|
+
|
8
|
+
This is the first release of Cucumber that runs on Ruby 1.9. There are still some encoding-related issues
|
9
|
+
with Arabic (ar), Japanese (ja) and Simplified Chinese (zh-CN). Patches are welcome. Other than that -
|
10
|
+
a couple of minor bug fixes and polishing.
|
11
|
+
|
3
12
|
=== New features
|
4
13
|
* Pretty formatter shows number of scenarios (#139 Joseph Wilk)
|
14
|
+
* Rudimentary support for Ruby 1.9. Now it's ok to file Ruby 1.9-related bugs.
|
5
15
|
|
6
16
|
=== Bugfixes
|
7
17
|
* Fixed "No such file or directory -- cucumber (LoadError)" bug with AutoTest (Aslak Hellesøy)
|
8
18
|
* Fixed `load_missing_constant': uninitialized constant Dispatcher error with Rails (Aslak Hellesøy)
|
9
19
|
|
10
20
|
=== Removed features
|
11
|
-
|
21
|
+
* The #binary= method is gone from the Rake task. It will always point to the binary in the current gem. (Aslak Hellesøy)
|
12
22
|
|
13
23
|
== 0.1.13 2008-12-20
|
14
24
|
|
data/Manifest.txt
CHANGED
@@ -65,6 +65,11 @@ examples/i18n/ja/features/addition.feature
|
|
65
65
|
examples/i18n/ja/features/division.feature
|
66
66
|
examples/i18n/ja/features/step_definitons/calculator_steps.rb
|
67
67
|
examples/i18n/ja/lib/calculator.rb
|
68
|
+
examples/i18n/ko/Rakefile
|
69
|
+
examples/i18n/ko/features/addition.feature
|
70
|
+
examples/i18n/ko/features/division.feature
|
71
|
+
examples/i18n/ko/features/step_definitons/calculator_steps.rb
|
72
|
+
examples/i18n/ko/lib/calculator.rb
|
68
73
|
examples/i18n/lt/Rakefile
|
69
74
|
examples/i18n/lt/features/addition.feature
|
70
75
|
examples/i18n/lt/features/division.feature
|
@@ -96,7 +101,6 @@ examples/java/features/hello.feature
|
|
96
101
|
examples/java/features/step_definitons/hello_steps.rb
|
97
102
|
examples/java/features/step_definitons/tree_steps.rb
|
98
103
|
examples/java/features/tree.feature
|
99
|
-
examples/java/src/cucumber/demo/Hello.java
|
100
104
|
examples/selenium/Rakefile
|
101
105
|
examples/selenium/features/search.feature
|
102
106
|
examples/selenium/features/step_definitons/stories_steps.rb
|
@@ -182,6 +186,7 @@ lib/cucumber/treetop_parser/feature_fr.rb
|
|
182
186
|
lib/cucumber/treetop_parser/feature_id.rb
|
183
187
|
lib/cucumber/treetop_parser/feature_it.rb
|
184
188
|
lib/cucumber/treetop_parser/feature_ja.rb
|
189
|
+
lib/cucumber/treetop_parser/feature_ko.rb
|
185
190
|
lib/cucumber/treetop_parser/feature_lt.rb
|
186
191
|
lib/cucumber/treetop_parser/feature_nl.rb
|
187
192
|
lib/cucumber/treetop_parser/feature_no.rb
|
data/config/hoe.rb
CHANGED
data/examples/i18n/Rakefile
CHANGED
@@ -4,13 +4,29 @@ 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
|
-
|
8
|
-
|
7
|
+
if supported?(lang)
|
8
|
+
Dir.chdir(f) do
|
9
|
+
rake("features")
|
10
|
+
end
|
11
|
+
else
|
12
|
+
STDERR.puts %{
|
13
|
+
!!!!!
|
14
|
+
!!!!! SKIPPING #{lang} (Haven't made it work on Ruby 1.9 yet)
|
15
|
+
!!!!!
|
16
|
+
}
|
9
17
|
end
|
10
18
|
end
|
11
19
|
end
|
12
20
|
end
|
13
21
|
|
22
|
+
def supported?(lang)
|
23
|
+
if RUBY_VERSION =~ /^1\.9/
|
24
|
+
!%w{ar ja ko zh-CN}.index(lang)
|
25
|
+
else
|
26
|
+
true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
14
30
|
def rake(args)
|
15
31
|
ruby(File.join(Gem.bindir, 'rake'), args)
|
16
32
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'spec' # so we can call .should
|
1
|
+
require 'spec/expectations' # so we can call .should
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../src') # so the jar is found
|
3
3
|
require 'cucumber_demo' # puts the jar on the classpath
|
4
4
|
include_class 'cucumber.demo.Hello'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Here you'll find examples for Watir, FireWatir, SafariWatir and Celerity.
|
2
|
+
All of these browser libraries have the same API, so the example code will
|
3
|
+
work with all of them.
|
4
|
+
|
5
|
+
Just run with:
|
6
|
+
|
7
|
+
rake features
|
8
|
+
|
9
|
+
This will use Watir/IE if you're on Windows, and SafariWatir/Safari if you're on OS X.
|
10
|
+
You can force the use of FireWatir/Firefox on any platform like this:
|
11
|
+
|
12
|
+
rake features FIREWATIR=true
|
13
|
+
|
14
|
+
And finally, you can use Celerity by running in JRuby:
|
15
|
+
|
16
|
+
jruby -S rake features
|
data/gem_tasks/rspec.rake
CHANGED
@@ -8,14 +8,14 @@ EOS
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def require_spec
|
11
|
-
require 'spec'
|
11
|
+
require 'spec/expectations'
|
12
12
|
rescue LoadError
|
13
13
|
require_spec_with_rubygems
|
14
14
|
end
|
15
15
|
|
16
16
|
def require_spec_with_rubygems
|
17
17
|
require 'rubygems'
|
18
|
-
require 'spec'
|
18
|
+
require 'spec/expectations'
|
19
19
|
rescue LoadError
|
20
20
|
unable_to_load
|
21
21
|
end
|
data/gem_tasks/treetop.rake
CHANGED
@@ -3,7 +3,7 @@ class FeatureCompiler
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'erb'
|
5
5
|
|
6
|
-
@tt =
|
6
|
+
@tt = RUBY_PLATFORM =~ /mswin|mingw/ ? 'tt.bat' : 'tt'
|
7
7
|
|
8
8
|
@template = ERB.new(IO.read(File.dirname(__FILE__) + '/../lib/cucumber/treetop_parser/feature.treetop.erb'))
|
9
9
|
@langs = YAML.load_file(File.dirname(__FILE__) + '/../lib/cucumber/languages.yml')
|
@@ -122,6 +122,6 @@ module Autotest::CucumberMixin
|
|
122
122
|
else
|
123
123
|
scenario_args = scenarios_to_run.map { |s| "-s '#{s}'" }.join(' ')
|
124
124
|
end
|
125
|
-
return "#{Cucumber::
|
125
|
+
return "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} #{args} #{scenario_args}"
|
126
126
|
end
|
127
127
|
end
|
data/lib/cucumber/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'optparse'
|
2
2
|
require 'cucumber'
|
3
|
+
require 'ostruct'
|
3
4
|
|
4
5
|
module Cucumber
|
5
6
|
class YmlLoadError < StandardError; end
|
@@ -344,7 +345,7 @@ Defined profiles in cucumber.yml:
|
|
344
345
|
def enable_diffing
|
345
346
|
if defined?(::Spec)
|
346
347
|
require 'spec/expectations/differs/default'
|
347
|
-
options =
|
348
|
+
options = OpenStruct.new(:diff_format => :unified, :context_lines => 3)
|
348
349
|
::Spec::Expectations.differ = ::Spec::Expectations::Differs::Default.new(options)
|
349
350
|
end
|
350
351
|
end
|
@@ -19,7 +19,7 @@ Term::ANSIColor.coloring = false if !STDOUT.tty? || (Cucumber::WINDOWS && !Cucum
|
|
19
19
|
module Cucumber
|
20
20
|
module Formatters
|
21
21
|
# Defines aliases for coloured output. You can tweak the colours by defining
|
22
|
-
# a <tt>
|
22
|
+
# a <tt>CUCUMBER_COLORS</tt> variable in your shell, very much like you can
|
23
23
|
# tweak the familiar POSIX command <tt>ls</tt> with
|
24
24
|
# <a href="http://mipsisrisc.com/rambling/2008/06/27/lscolorsls_colors-now-with-linux-support/">$LSCOLORS/$LS_COLORS</a>
|
25
25
|
#
|
@@ -178,15 +178,16 @@ module Cucumber
|
|
178
178
|
|
179
179
|
print_pending_messages if @pending_messages.any?
|
180
180
|
|
181
|
-
@io.puts
|
181
|
+
@io.puts dump_count(@total_scenario_count, "scenario")
|
182
182
|
|
183
|
-
@io.puts pending(
|
183
|
+
@io.puts pending(dump_count(@pending_scenarios.length, "scenario", "pending")) if @pending_scenarios.any?
|
184
|
+
|
185
|
+
@io.puts passed(dump_count(@passed.length, "step", "passed")) if @passed.any?
|
186
|
+
@io.puts passed(dump_count(@failed.length, "step", "failed")) if @failed.any?
|
187
|
+
@io.puts passed(dump_count(@skipped.length, "step", "skipped")) if @skipped.any?
|
184
188
|
|
185
|
-
@io.puts passed("#{@passed.length} steps passed") if @passed.any?
|
186
|
-
@io.puts failed("#{@failed.length} steps failed") if @failed.any?
|
187
|
-
@io.puts skipped("#{@skipped.length} steps skipped") if @skipped.any?
|
188
189
|
if @pending_steps.any?
|
189
|
-
@io.print pending(
|
190
|
+
@io.print pending(dump_count(@pending_steps.length, "step", "pending"))
|
190
191
|
@io.print pending(" (#{number_of_unimplemented_steps} with no step definition)") if number_of_unimplemented_steps > 0
|
191
192
|
@io.puts
|
192
193
|
end
|
@@ -195,6 +196,10 @@ module Cucumber
|
|
195
196
|
|
196
197
|
print_snippets if @options[:snippets]
|
197
198
|
end
|
199
|
+
|
200
|
+
def dump_count(count, what, state=nil)
|
201
|
+
return [count, "#{what}#{count == 1 ? '' : 's'}", state].compact.join(" ")
|
202
|
+
end
|
198
203
|
|
199
204
|
def print_pending_messages
|
200
205
|
@io.puts "Pending Notes:"
|
data/lib/cucumber/languages.yml
CHANGED
data/lib/cucumber/platform.rb
CHANGED
@@ -10,7 +10,8 @@ module Cucumber
|
|
10
10
|
WINDOWS = Config::CONFIG['host_os'] =~ /mswin|mingw/
|
11
11
|
WINDOWS_MRI = WINDOWS && !JRUBY && !IRONRUBY
|
12
12
|
RAILS = defined?(Rails)
|
13
|
-
|
13
|
+
RUBY_BINARY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
|
14
|
+
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/
|
14
15
|
|
15
16
|
class << self
|
16
17
|
attr_reader :language
|
data/lib/cucumber/rails/rspec.rb
CHANGED
@@ -20,7 +20,9 @@ module Cucumber
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def parse_feature(file)
|
23
|
-
|
23
|
+
gherkin = IO.read(file)
|
24
|
+
gherkin = gherkin.force_encoding('utf-8') if Cucumber::RUBY_1_9
|
25
|
+
ast = parse(gherkin)
|
24
26
|
if ast.nil?
|
25
27
|
raise SyntaxError.new(file, self)
|
26
28
|
else
|
data/lib/cucumber/version.rb
CHANGED
@@ -86,7 +86,14 @@ module Cucumber
|
|
86
86
|
it "should display as pending in the dump" do
|
87
87
|
@formatter.scenario_executing(@scenario)
|
88
88
|
@formatter.dump
|
89
|
-
@io.string.should include("1
|
89
|
+
@io.string.should include("1 scenario pending")
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should display as pending in the dump (with two scenarios)" do
|
93
|
+
@formatter.scenario_executing(@scenario)
|
94
|
+
@formatter.scenario_executing(@scenario)
|
95
|
+
@formatter.dump
|
96
|
+
@io.string.should include("2 scenarios pending")
|
90
97
|
end
|
91
98
|
end
|
92
99
|
|
@@ -315,16 +322,40 @@ module Cucumber
|
|
315
322
|
io.string.should include("1 with no step definition")
|
316
323
|
end
|
317
324
|
|
318
|
-
it "should display the total number of scenarios executed" do
|
325
|
+
it "should display the total number of scenarios executed (for 0 scenarios)" do
|
319
326
|
io = StringIO.new
|
320
327
|
formatter = PrettyFormatter.new io, mock('step_mother')
|
321
328
|
|
329
|
+
formatter.dump
|
330
|
+
|
331
|
+
io.string.should include("0 scenarios")
|
332
|
+
end
|
333
|
+
|
334
|
+
it "should display the total number of scenarios executed (for 1 scenario)" do
|
335
|
+
io = StringIO.new
|
336
|
+
formatter = PrettyFormatter.new io, mock('step_mother')
|
337
|
+
|
338
|
+
formatter.scenario_executing(mock_scenario)
|
339
|
+
formatter.scenario_executed(mock_scenario)
|
340
|
+
|
341
|
+
formatter.dump
|
342
|
+
|
343
|
+
io.string.should include("1 scenario")
|
344
|
+
end
|
345
|
+
|
346
|
+
it "should display the total number of scenarios executed (for 2 scenarios)" do
|
347
|
+
io = StringIO.new
|
348
|
+
formatter = PrettyFormatter.new io, mock('step_mother')
|
349
|
+
|
350
|
+
formatter.scenario_executing(mock_scenario)
|
351
|
+
formatter.scenario_executed(mock_scenario)
|
352
|
+
|
322
353
|
formatter.scenario_executing(mock_scenario)
|
323
354
|
formatter.scenario_executed(mock_scenario)
|
324
355
|
|
325
356
|
formatter.dump
|
326
357
|
|
327
|
-
io.string.should include("
|
358
|
+
io.string.should include("2 scenarios")
|
328
359
|
end
|
329
360
|
|
330
361
|
describe "colour" do
|
data/spec/spec_helper.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.14.1
|
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:
|
12
|
+
date: 2009-01-05 00:00:00 -08:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -160,7 +160,6 @@ files:
|
|
160
160
|
- examples/java/features/step_definitons/hello_steps.rb
|
161
161
|
- examples/java/features/step_definitons/tree_steps.rb
|
162
162
|
- examples/java/features/tree.feature
|
163
|
-
- examples/java/src/cucumber/demo/Hello.java
|
164
163
|
- examples/selenium/Rakefile
|
165
164
|
- examples/selenium/features/search.feature
|
166
165
|
- examples/selenium/features/step_definitons/stories_steps.rb
|
@@ -175,6 +174,7 @@ files:
|
|
175
174
|
- examples/tickets/features/step_definitons/scenario_outline_steps.rb
|
176
175
|
- examples/tickets/features/step_definitons/tickets_steps.rb
|
177
176
|
- examples/tickets/features/tickets.feature
|
177
|
+
- examples/watir/README.textile
|
178
178
|
- examples/watir/Rakefile
|
179
179
|
- examples/watir/features/search.feature
|
180
180
|
- examples/watir/features/step_definitons/search_steps.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
package cucumber.demo;
|
2
|
-
|
3
|
-
public class Hello {
|
4
|
-
public String greet(String who, String from) {
|
5
|
-
return "Hi, " + who + ". I'm " + from;
|
6
|
-
}
|
7
|
-
|
8
|
-
public boolean isFriend(String who) {
|
9
|
-
return true;
|
10
|
-
}
|
11
|
-
|
12
|
-
public String getPhoneNumber(String who) {
|
13
|
-
throw new RuntimeException("NOPE");
|
14
|
-
//return "98219458";
|
15
|
-
}
|
16
|
-
}
|