cucumber 0.1.13 → 0.1.14
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 +17 -0
- data/Manifest.txt +3 -2
- data/README.txt +3 -2
- 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/scenario_outline.feature +26 -0
- data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +8 -0
- data/examples/tickets/features/step_definitons/tickets_steps.rb +1 -1
- data/examples/watir/README.textile +16 -0
- data/examples/watir/features/step_definitons/search_steps.rb +27 -0
- data/examples/watir/features/support/env.rb +32 -0
- data/gem_tasks/deployment.rake +0 -23
- data/gem_tasks/gemspec.rake +4 -0
- data/gem_tasks/rspec.rake +2 -2
- data/gem_tasks/treetop.rake +1 -1
- data/lib/autotest/cucumber_mixin.rb +1 -5
- data/lib/cucumber.rb +0 -21
- data/lib/cucumber/cli.rb +2 -1
- data/lib/cucumber/core_ext/string.rb +1 -1
- data/lib/cucumber/formatters/ansicolor.rb +8 -3
- data/lib/cucumber/formatters/pretty_formatter.rb +17 -8
- data/lib/cucumber/formatters/unicode.rb +5 -5
- data/lib/cucumber/platform.rb +28 -6
- data/lib/cucumber/rails/rspec.rb +1 -1
- data/lib/cucumber/rails/world.rb +1 -1
- data/lib/cucumber/rake/task.rb +3 -3
- 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 +3 -2
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +46 -2
- data/spec/cucumber/model/table_spec.rb +19 -5
- data/spec/cucumber/rails/stubs/mini_rails.rb +4 -3
- data/spec/cucumber/tree/step_outline_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +5 -4
- data/examples/java/src/cucumber/demo/Hello.java +0 -16
- data/examples/watir/features/step_definitons/stories_steps.rb +0 -51
data/History.txt
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
== 0.1.14 2009-01-04
|
|
2
|
+
|
|
3
|
+
This is the first release of Cucumber that runs on Ruby 1.9. There are still some encoding-related issues
|
|
4
|
+
with Arabic (ar), Japanese (ja) and Simplified Chinese (zh-CN). Patches are welcome. Other than that -
|
|
5
|
+
a couple of minor bug fixes and polishing.
|
|
6
|
+
|
|
7
|
+
=== New features
|
|
8
|
+
* Pretty formatter shows number of scenarios (#139 Joseph Wilk)
|
|
9
|
+
* Rudimentary support for Ruby 1.9. Now it's ok to file Ruby 1.9-related bugs.
|
|
10
|
+
|
|
11
|
+
=== Bugfixes
|
|
12
|
+
* Fixed "No such file or directory -- cucumber (LoadError)" bug with AutoTest (Aslak Hellesøy)
|
|
13
|
+
* Fixed `load_missing_constant': uninitialized constant Dispatcher error with Rails (Aslak Hellesøy)
|
|
14
|
+
|
|
15
|
+
=== Removed features
|
|
16
|
+
* The #binary= method is gone from the Rake task. It will always point to the binary in the current gem. (Aslak Hellesøy)
|
|
17
|
+
|
|
1
18
|
== 0.1.13 2008-12-20
|
|
2
19
|
|
|
3
20
|
It's time for some new features again. Output is now much better since you can use diffing, tweak
|
data/Manifest.txt
CHANGED
|
@@ -96,7 +96,6 @@ examples/java/features/hello.feature
|
|
|
96
96
|
examples/java/features/step_definitons/hello_steps.rb
|
|
97
97
|
examples/java/features/step_definitons/tree_steps.rb
|
|
98
98
|
examples/java/features/tree.feature
|
|
99
|
-
examples/java/src/cucumber/demo/Hello.java
|
|
100
99
|
examples/selenium/Rakefile
|
|
101
100
|
examples/selenium/features/search.feature
|
|
102
101
|
examples/selenium/features/step_definitons/stories_steps.rb
|
|
@@ -111,9 +110,11 @@ examples/tickets/features/scenario_outline.feature
|
|
|
111
110
|
examples/tickets/features/step_definitons/scenario_outline_steps.rb
|
|
112
111
|
examples/tickets/features/step_definitons/tickets_steps.rb
|
|
113
112
|
examples/tickets/features/tickets.feature
|
|
113
|
+
examples/watir/README.textile
|
|
114
114
|
examples/watir/Rakefile
|
|
115
115
|
examples/watir/features/search.feature
|
|
116
|
-
examples/watir/features/step_definitons/
|
|
116
|
+
examples/watir/features/step_definitons/search_steps.rb
|
|
117
|
+
examples/watir/features/support/env.rb
|
|
117
118
|
features/see_features.feature
|
|
118
119
|
features/steps/features_steps.rb
|
|
119
120
|
gem_tasks/deployment.rake
|
data/README.txt
CHANGED
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}.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'
|
|
@@ -61,4 +61,30 @@ Feature: Outlines
|
|
|
61
61
|
| 4 | strawberrys| 1 |
|
|
62
62
|
| 2 | apricots | 5 |
|
|
63
63
|
|
|
64
|
+
Scenario Outline: placeholder in a multiline string
|
|
65
|
+
Given my shopping list
|
|
66
|
+
"""
|
|
67
|
+
Must buy some <fruits>
|
|
68
|
+
"""
|
|
69
|
+
Then my shopping list should equal
|
|
70
|
+
"""
|
|
71
|
+
Must buy some cucumbers
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
Examples:
|
|
75
|
+
| fruits |
|
|
76
|
+
| cucumbers |
|
|
77
|
+
|
|
78
|
+
Scenario Outline: placeholder in step table
|
|
79
|
+
Given I have the following fruits in my pantry
|
|
80
|
+
| name | quantity |
|
|
81
|
+
| cucumbers | <quant_cukes> |
|
|
82
|
+
| strawberrys | <quant_straw> |
|
|
64
83
|
|
|
84
|
+
When I eat <number> <fruits> from the pantry
|
|
85
|
+
Then I should have <left> <fruits> in the pantry
|
|
86
|
+
|
|
87
|
+
Examples:
|
|
88
|
+
| quant_cukes | quant_straw | number | fruits | left |
|
|
89
|
+
| 10 | 5 | 2 | cucumbers | 8 |
|
|
90
|
+
| 5 | 5 | 4 | strawberrys | 1 |
|
|
@@ -12,6 +12,10 @@ Given "I have the following fruits in my pantry" do |pantry_table|
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
Given "my shopping list" do |list|
|
|
16
|
+
@shopping_list = list
|
|
17
|
+
end
|
|
18
|
+
|
|
15
19
|
When /^I eat (\d+) (\w+)$/ do |count, fruit|
|
|
16
20
|
@eattingMachine.eat(count)
|
|
17
21
|
@eattingMachine.belly_count = count.to_i
|
|
@@ -32,3 +36,7 @@ end
|
|
|
32
36
|
Then /^I should have (\d+) (\w+) in the pantry$/ do |count, fruit|
|
|
33
37
|
@pantry.count(fruit).should == count.to_i
|
|
34
38
|
end
|
|
39
|
+
|
|
40
|
+
Then /^my shopping list should equal$/ do |list|
|
|
41
|
+
@shopping_list.should == list
|
|
42
|
+
end
|
|
@@ -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
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class GoogleSearch
|
|
2
|
+
def initialize(browser)
|
|
3
|
+
@browser = browser
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def goto
|
|
7
|
+
@browser.goto 'http://www.google.com/'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def search(text)
|
|
11
|
+
@browser.text_field(:name, 'q').set(text)
|
|
12
|
+
@browser.button(:name, 'btnG').click
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
Given 'I am on the Google search page' do
|
|
17
|
+
@page = GoogleSearch.new(@browser)
|
|
18
|
+
@page.goto
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
When /I search for "(.*)"/ do |query|
|
|
22
|
+
@page.search(query)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
Then /I should see a link to "(.*)":(.*)/ do |text, url|
|
|
26
|
+
@browser.link(:url, url).text.should == text
|
|
27
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'spec/expectations'
|
|
2
|
+
|
|
3
|
+
if ENV['FIREWATIR']
|
|
4
|
+
require 'firewatir'
|
|
5
|
+
Browser = FireWatir::Firefox
|
|
6
|
+
else
|
|
7
|
+
case RUBY_PLATFORM
|
|
8
|
+
when /darwin/
|
|
9
|
+
require 'safariwatir'
|
|
10
|
+
Browser = Watir::Safari
|
|
11
|
+
when /win32|mingw/
|
|
12
|
+
require 'watir'
|
|
13
|
+
Browser = Watir::IE
|
|
14
|
+
when /java/
|
|
15
|
+
require 'celerity'
|
|
16
|
+
Browser = Celerity::Browser
|
|
17
|
+
else
|
|
18
|
+
raise "This platform is not supported (#{PLATFORM})"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# "before all"
|
|
23
|
+
browser = Browser.new
|
|
24
|
+
|
|
25
|
+
Before do
|
|
26
|
+
@browser = browser
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# "after all"
|
|
30
|
+
at_exit do
|
|
31
|
+
browser.close
|
|
32
|
+
end
|
data/gem_tasks/deployment.rake
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
desc 'Release the website and new gem version'
|
|
2
|
-
task :deploy => [:check_version, :website, :release] do
|
|
3
|
-
puts "Remember to create SVN tag:"
|
|
4
|
-
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
|
5
|
-
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
|
6
|
-
puts "Suggested comment:"
|
|
7
|
-
puts "Tagging release #{CHANGES}"
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
|
11
|
-
task :local_deploy => [:website_generate, :install_gem]
|
|
12
|
-
|
|
13
|
-
task :check_version do
|
|
14
|
-
unless ENV['VERSION']
|
|
15
|
-
puts 'Must pass a VERSION=x.y.z release version'
|
|
16
|
-
exit
|
|
17
|
-
end
|
|
18
|
-
unless ENV['VERSION'] == VERS
|
|
19
|
-
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
|
20
|
-
exit
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
1
|
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
|
25
2
|
task :install_gem_no_doc => [:clean, :package] do
|
|
26
3
|
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
data/gem_tasks/gemspec.rake
CHANGED
|
@@ -2,5 +2,9 @@ namespace :gemspec do
|
|
|
2
2
|
desc 'Refresh cucumber.gemspec to include ALL files'
|
|
3
3
|
task :refresh => 'manifest:refresh' do
|
|
4
4
|
File.open('cucumber.gemspec', 'w') {|io| io.write($hoe.spec.to_ruby)}
|
|
5
|
+
puts "1) git commit -a -m \"Release #{Cucumber::VERSION::STRING}\""
|
|
6
|
+
puts "2) git tag -a \"v#{Cucumber::VERSION::STRING}\" -m \"Release #{Cucumber::VERSION::STRING}\""
|
|
7
|
+
puts "3) git push --tags"
|
|
8
|
+
puts "4) Bounce the version in version.rb"
|
|
5
9
|
end
|
|
6
10
|
end
|
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')
|