jeffrafter-cucumber 0.1.10 → 0.1.12
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 +10 -2
- data/Manifest.txt +1 -0
- data/gem_tasks/rspec.rake +2 -2
- data/lib/autotest/cucumber_mixin.rb +23 -1
- data/lib/cucumber/cli.rb +13 -2
- data/lib/cucumber/core_ext/string.rb +2 -1
- data/lib/cucumber/executor.rb +0 -2
- data/lib/cucumber/platform.rb +1 -0
- data/lib/cucumber/step_mother.rb +1 -1
- data/lib/cucumber/tree.rb +0 -2
- data/lib/cucumber/tree/scenario.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +1591 -0
- data/lib/cucumber/version.rb +1 -1
- data/rails_generators/cucumber/templates/env.rb +4 -1
- data/rails_generators/cucumber/templates/webrat_steps.rb +14 -16
- data/spec/cucumber/cli_spec.rb +24 -5
- metadata +3 -2
data/lib/cucumber/version.rb
CHANGED
@@ -4,5 +4,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
|
4
4
|
require 'cucumber/rails/world'
|
5
5
|
Cucumber::Rails.use_transactional_fixtures
|
6
6
|
|
7
|
-
|
7
|
+
require 'webrat/rails'
|
8
|
+
|
9
|
+
# Comment out the next two lines if you're not using RSpec's matchers (should / should_not) in your steps.
|
8
10
|
require 'cucumber/rails/rspec'
|
11
|
+
require 'webrat/rspec-rails'
|
@@ -1,28 +1,26 @@
|
|
1
1
|
# Commonly used webrat steps
|
2
2
|
# http://github.com/brynary/webrat
|
3
3
|
|
4
|
-
require 'webrat' if !defined?(Webrat) # Because some people have it installed as a Gem
|
5
|
-
|
6
4
|
When /^I press "(.*)"$/ do |button|
|
7
|
-
|
5
|
+
click_button(button)
|
8
6
|
end
|
9
7
|
|
10
8
|
When /^I follow "(.*)"$/ do |link|
|
11
|
-
|
9
|
+
click_link(link)
|
12
10
|
end
|
13
11
|
|
14
12
|
When /^I fill in "(.*)" with "(.*)"$/ do |field, value|
|
15
|
-
|
13
|
+
fill_in(field, :with => value)
|
16
14
|
end
|
17
15
|
|
18
16
|
When /^I select "(.*)" from "(.*)"$/ do |value, field|
|
19
|
-
|
17
|
+
select(value, :from => field)
|
20
18
|
end
|
21
19
|
|
22
20
|
# Use this step in conjunction with Rail's datetime_select helper. For example:
|
23
21
|
# When I select "December 25, 2008 10:00" as the date and time
|
24
22
|
When /^I select "(.*)" as the date and time$/ do |time|
|
25
|
-
|
23
|
+
select_datetime(time)
|
26
24
|
end
|
27
25
|
|
28
26
|
# Use this step when using multiple datetime_select helpers on a page or
|
@@ -35,7 +33,7 @@ end
|
|
35
33
|
# When I select "November 23, 2004 11:20" as the "Preferred" data and time
|
36
34
|
# And I select "November 25, 2004 10:30" as the "Alternative" data and time
|
37
35
|
When /^I select "(.*)" as the "(.*)" date and time$/ do |datetime, datetime_label|
|
38
|
-
|
36
|
+
select_datetime(datetime, :from => datetime_label)
|
39
37
|
end
|
40
38
|
|
41
39
|
# Use this step in conjuction with Rail's time_select helper. For example:
|
@@ -43,43 +41,43 @@ end
|
|
43
41
|
# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
|
44
42
|
# will convert the 2:20PM to 14:20 and then select it.
|
45
43
|
When /^I select "(.*)" as the time$/ do |time|
|
46
|
-
|
44
|
+
select_time(time)
|
47
45
|
end
|
48
46
|
|
49
47
|
# Use this step when using multiple time_select helpers on a page or you want to
|
50
48
|
# specify the name of the time on the form. For example:
|
51
49
|
# When I select "7:30AM" as the "Gym" time
|
52
50
|
When /^I select "(.*)" as the "(.*)" time$/ do |time, time_label|
|
53
|
-
|
51
|
+
select_time(time, :from => time_label)
|
54
52
|
end
|
55
53
|
|
56
54
|
# Use this step in conjuction with Rail's date_select helper. For example:
|
57
55
|
# When I select "February 20, 1981" as the date
|
58
56
|
When /^I select "(.*)" as the date$/ do |date|
|
59
|
-
|
57
|
+
select_date(date)
|
60
58
|
end
|
61
59
|
|
62
60
|
# Use this step when using multiple date_select helpers on one page or
|
63
61
|
# you want to specify the name of the date on the form. For example:
|
64
62
|
# When I select "April 26, 1982" as the "Date of Birth" date
|
65
63
|
When /^I select "(.*)" as the "(.*)" date$/ do |date, date_label|
|
66
|
-
|
64
|
+
select_date(date, :from => date_label)
|
67
65
|
end
|
68
66
|
|
69
67
|
When /^I check "(.*)"$/ do |field|
|
70
|
-
|
68
|
+
check(field)
|
71
69
|
end
|
72
70
|
|
73
71
|
When /^I uncheck "(.*)"$/ do |field|
|
74
|
-
|
72
|
+
uncheck(field)
|
75
73
|
end
|
76
74
|
|
77
75
|
When /^I choose "(.*)"$/ do |field|
|
78
|
-
|
76
|
+
choose(field)
|
79
77
|
end
|
80
78
|
|
81
79
|
When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
|
82
|
-
|
80
|
+
attach_file(field, path)
|
83
81
|
end
|
84
82
|
|
85
83
|
Then /^I should see "(.*)"$/ do |text|
|
data/spec/cucumber/cli_spec.rb
CHANGED
@@ -217,14 +217,32 @@ Defined profiles in cucumber.yml:
|
|
217
217
|
|
218
218
|
cli.execute!(stub('step mother'), mock_executor, stub('features'))
|
219
219
|
end
|
220
|
+
|
221
|
+
describe "--format with class" do
|
222
|
+
|
223
|
+
describe "in module" do
|
224
|
+
|
225
|
+
it "should resolve each module until it gets Formatter class" do
|
226
|
+
cli = CLI.new
|
227
|
+
mock_module = mock('module')
|
228
|
+
cli.parse_options!(%w{--format ZooModule::MonkeyFormatterClass})
|
229
|
+
Object.stub!(:const_defined?).and_return(true)
|
230
|
+
mock_module.stub!(:const_defined?).and_return(true)
|
220
231
|
|
221
|
-
|
232
|
+
Object.should_receive(:const_get).with('ZooModule').and_return(mock_module)
|
233
|
+
mock_module.should_receive(:const_get).with('MonkeyFormatterClass').and_return(mock('formatter class', :new => nil))
|
234
|
+
|
235
|
+
cli.execute!(stub('step mother'), mock_executor, stub('features'))
|
236
|
+
end
|
222
237
|
|
238
|
+
end
|
239
|
+
|
223
240
|
describe "exists and valid constructor" do
|
224
|
-
|
241
|
+
|
225
242
|
before(:each) do
|
226
243
|
@mock_formatter_class = mock('formatter class')
|
227
|
-
|
244
|
+
Object.stub!(:const_get).and_return(@mock_formatter_class)
|
245
|
+
Object.stub!(:const_defined?).with('magical').and_return(true)
|
228
246
|
end
|
229
247
|
|
230
248
|
it "should create the formatter" do
|
@@ -236,7 +254,7 @@ Defined profiles in cucumber.yml:
|
|
236
254
|
|
237
255
|
cli.execute!(stub('step mother'), mock_executor, stub('features'))
|
238
256
|
end
|
239
|
-
|
257
|
+
|
240
258
|
it "should register the formatter with broadcaster" do
|
241
259
|
cli = CLI.new
|
242
260
|
broadcaster = Broadcaster.new
|
@@ -261,7 +279,8 @@ Defined profiles in cucumber.yml:
|
|
261
279
|
|
262
280
|
mock_formatter_class = stub('formatter class')
|
263
281
|
mock_formatter_class.stub!(:new).and_raise("No such method")
|
264
|
-
|
282
|
+
Object.stub!(:const_get).and_return(mock_formatter_class)
|
283
|
+
Object.stub!(:const_defined?).with('exists_but_evil').and_return(true)
|
265
284
|
|
266
285
|
@cli.parse_options!(%w{--format exists_but_evil})
|
267
286
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeffrafter-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
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: 2008-
|
12
|
+
date: 2008-12-02 00:00:00 -08:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- lib/cucumber/treetop_parser/feature_cy.rb
|
232
232
|
- lib/cucumber/treetop_parser/feature_da.rb
|
233
233
|
- lib/cucumber/treetop_parser/feature_de.rb
|
234
|
+
- lib/cucumber/treetop_parser/feature_en-lol.rb
|
234
235
|
- lib/cucumber/treetop_parser/feature_en-tx.rb
|
235
236
|
- lib/cucumber/treetop_parser/feature_en.rb
|
236
237
|
- lib/cucumber/treetop_parser/feature_es.rb
|