cucumber_monitor 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/test/step_test.rb CHANGED
@@ -9,13 +9,14 @@ class StepTest < ActiveSupport::TestCase
9
9
  'Given I am at the google page',
10
10
  'When I search for "New York Times"',
11
11
  'Then I should see "The New York Times - Breaking News, World News & Multimedia"',
12
+ 'And I should see 1 occurrence of "New York Times Company"'
12
13
  ]
13
14
  assert_equal siblings, step.siblings_and_self.map(&:description)
14
15
  end
15
16
 
16
17
  test "step should get the previous step" do
17
18
  last_step = @feature_two.scenarios.first.steps.last
18
- previous_step = 'When I search for "New York Times"'
19
+ previous_step = 'Then I should see "The New York Times - Breaking News, World News & Multimedia"'
19
20
  assert_equal previous_step, last_step.previous.description
20
21
  end
21
22
 
@@ -38,10 +39,39 @@ class StepTest < ActiveSupport::TestCase
38
39
  first_step = feature.scenarios.first.steps.first
39
40
 
40
41
  expected_definition_lines = ['Given /^I am at the google page$/ do', 'visit "http://www.google.com"', 'end']
42
+ expected_definition_location = 'google_search_step.rb:1'
41
43
 
42
- # expected_first_step_definition = 'google_search_step.rb:1'
43
44
 
44
45
  assert_equal expected_definition_lines, first_step.definition.content
46
+ assert_equal expected_definition_location, first_step.definition.location
47
+ end
48
+
49
+ test "step should tell when a step was not implemented yet" do
50
+ feature = @cucumber.features.where(name: 'change_my_data')
51
+ step = feature.scenarios.first.steps.first
52
+
53
+ assert_nil step.definition
54
+ assert !step.implemented?
55
+ end
56
+
57
+ test "step should return its params when applicable" do
58
+ feature = @cucumber.features.where(name: 'google_search')
59
+ step = feature.scenarios.first.steps.last
60
+
61
+ assert_equal 2, step.params.size
62
+ end
63
+
64
+ test "step should return description without keyword" do
65
+ feature = @cucumber.features.where(name: 'google_search')
66
+ description_without_keyword_1 = 'I am at the google page'
67
+ description_without_keyword_2 = 'I search for "New York Times"'
68
+ description_without_keyword_3 = 'I should see "The New York Times - Breaking News, World News & Multimedia"'
69
+ description_without_keyword_4 = 'I should see 1 occurrence of "New York Times Company"'
70
+
71
+ assert_equal description_without_keyword_1, feature.scenarios.first.steps[0].description_without_keyword
72
+ assert_equal description_without_keyword_2, feature.scenarios.first.steps[1].description_without_keyword
73
+ assert_equal description_without_keyword_3, feature.scenarios.first.steps[2].description_without_keyword
74
+ assert_equal description_without_keyword_4, feature.scenarios.first.steps[3].description_without_keyword
45
75
  end
46
76
 
47
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -84,6 +84,7 @@ files:
84
84
  - test/base_test.rb
85
85
  - test/context_test.rb
86
86
  - test/cucumber_monitor_test.rb
87
+ - test/definition_test.rb
87
88
  - test/dummy/app/assets/javascripts/application.js
88
89
  - test/dummy/app/assets/stylesheets/application.css
89
90
  - test/dummy/app/controllers/application_controller.rb
@@ -106,6 +107,7 @@ files:
106
107
  - test/dummy/config/locales/en.yml
107
108
  - test/dummy/config/routes.rb
108
109
  - test/dummy/config.ru
110
+ - test/dummy/db/development.sqlite3
109
111
  - test/dummy/db/test.sqlite3
110
112
  - test/dummy/features/administration.feature
111
113
  - test/dummy/features/change_my_data.feature
@@ -124,7 +126,6 @@ files:
124
126
  - test/dummy/README.rdoc
125
127
  - test/dummy/script/cucumber
126
128
  - test/dummy/script/rails
127
- - test/dummy/tmp/cucumber.out
128
129
  - test/feature_file_test.rb
129
130
  - test/integration/navigation_test.rb
130
131
  - test/scenario_test.rb
@@ -151,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
152
  version: '0'
152
153
  requirements: []
153
154
  rubyforge_project:
154
- rubygems_version: 1.8.24
155
+ rubygems_version: 1.8.22
155
156
  signing_key:
156
157
  specification_version: 3
157
158
  summary: Puts your features in a highlighted position. Adds a dashboard for viewing,
@@ -160,6 +161,7 @@ test_files:
160
161
  - test/base_test.rb
161
162
  - test/context_test.rb
162
163
  - test/cucumber_monitor_test.rb
164
+ - test/definition_test.rb
163
165
  - test/dummy/app/assets/javascripts/application.js
164
166
  - test/dummy/app/assets/stylesheets/application.css
165
167
  - test/dummy/app/controllers/application_controller.rb
@@ -182,6 +184,7 @@ test_files:
182
184
  - test/dummy/config/locales/en.yml
183
185
  - test/dummy/config/routes.rb
184
186
  - test/dummy/config.ru
187
+ - test/dummy/db/development.sqlite3
185
188
  - test/dummy/db/test.sqlite3
186
189
  - test/dummy/features/administration.feature
187
190
  - test/dummy/features/change_my_data.feature
@@ -200,7 +203,6 @@ test_files:
200
203
  - test/dummy/README.rdoc
201
204
  - test/dummy/script/cucumber
202
205
  - test/dummy/script/rails
203
- - test/dummy/tmp/cucumber.out
204
206
  - test/feature_file_test.rb
205
207
  - test/integration/navigation_test.rb
206
208
  - test/scenario_test.rb
@@ -1 +0,0 @@
1
- [{"keyword":"Feature","name":"Searching on Google","line":2,"description":"","tags":[{"name":"@mechanize","line":1}],"id":"searching-on-google","uri":"features/google_search.feature","elements":[{"keyword":"Scenario","name":"Search for New York Times","line":3,"description":"","id":"searching-on-google;search-for-new-york-times","type":"scenario","steps":[{"keyword":"Given ","name":"I am at the google page","line":4,"match":{"location":"features/step_definitions/google_search_step.rb:1"},"result":{"status":"passed"}},{"keyword":"When ","name":"I search for \"New York Times\"","line":5,"match":{"arguments":[{"offset":14,"val":"New York Times"}],"location":"features/step_definitions/google_search_step.rb:5"},"result":{"status":"passed"}},{"keyword":"Then ","name":"I should se \"The New York Times - Breaking News, World News & Multimedia\"","line":6,"match":{"arguments":[{"offset":13,"val":"The New York Times - Breaking News, World News & Multimedia"}],"location":"features/step_definitions/google_search_step.rb:9"},"result":{"status":"passed"}}]}]}]