cucumber_analytics 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODMwNzMzY2IxOTc5ZGE2ODJkZmJiOWYyMTA2YzJmYTJhZmRmMzIyYg==
4
+ NDkwYTdjMjFkYjI2OWQ4MmM0ZTZiMDBkNmYxYThlYmM0MjE2MmQzMQ==
5
5
  data.tar.gz: !binary |-
6
- MzIzZjdhMDQ4NDgzOWNjMTJlMGZlYjIwOGI5NTYwNmYwY2VmNGQ0Ng==
6
+ MWNjMmQ3NTJkY2QyOTk1MmJlZmE5YTMyNDNkOTQxNzUzODcxYjE4NA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OTZiODdmMzE4YzI5ZmU2NzhlYjIyYzJiYzYxYjIzZjdkNmFkY2E0YzdhOTMw
10
- Yjg3ZjkwYTQxMmQ5NmFkNDc2YjBlYTMxNzgzYzFlNDM3YjU2MDM0YmNlYTQx
11
- ZDNhZjQyMGZkMjI3NWI1ZWIxZTk2NjQwNzU1N2FkZTZhMDYxYWE=
9
+ YTI4ODRhMjE0OGIzOTgxODM1NTdhM2FiOTQ2MmM5M2ZmNDZkOTFjMTZlYWI2
10
+ NTJmMmFlYzIzY2U2MWJhNDQ4ZjkxNzJhMGNlNmFlZTgxY2E2MzFlM2QyOWQy
11
+ MWYxZDdmYzg0ZDI5ZGNhMTcyODM4ZmI4OTc2MzQ0NjU4N2IxOTc=
12
12
  data.tar.gz: !binary |-
13
- N2QyZDg5YTQ0ZDc0ZmNjNzNiYTFmY2JiOGFjYjUwYjlhOGU1M2EyNTQzZjNk
14
- ZWU3YmNlYjFjOWJlOGY3NWFiMDM4Yjc5YWIwZmFkZmM4NzBmOWU0NDc2ZDRm
15
- MDA1Nzc2ODhmNGM5MDRlNjZlMjY0YWQwZTliMjhiYTRhOWE3MmI=
13
+ NzhhNDJmYWVmMjE0ZWNjNDdkZTAwMTkxZmQ0MDUwOThiNzNkMGRkYWQ3OTNk
14
+ YTcxOGZkMGUzMzMwY2MyMDNiYTkyNmViNDdhZWNlZjA5YjM3YjkxMjcwOTM1
15
+ NWE5YWVkZjU2NDNlZDZkMDgxMDNlMWQ4NzJkZjBkM2RlZGRlNDU=
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ === Version 1.4.2 / 2014-01-26
2
+
3
+ * Bug fix: Example#add_row no longer assumes that the key/value pairs in a
4
+ Hash are ordered. This was causing values in the added row to be assigned
5
+ to the incorrect parameter when using versions of Ruby before 1.9.x.
6
+
7
+
1
8
  === Version 1.4.1 / 2013-12-25
2
9
 
3
10
  * Bug fix: Trailing empty lines are no longer left out of the contents of doc
@@ -47,7 +47,7 @@ module CucumberAnalytics
47
47
  @row_elements << Row.new("|#{row.join('|')}|")
48
48
  when row.is_a?(Hash)
49
49
  @rows << row.each_value { |value| value.strip! }
50
- @row_elements << Row.new("|#{row.values.join('|')}|")
50
+ @row_elements << Row.new("|#{ordered_row_values(row).join('|')}|")
51
51
  else
52
52
  raise(ArgumentError, "Can only add row from a Hash or an Array but received #{row.class}")
53
53
  end
@@ -122,5 +122,8 @@ module CucumberAnalytics
122
122
  end
123
123
  end
124
124
 
125
+ def ordered_row_values(row_hash)
126
+ @parameters.collect { |parameter| row_hash[parameter] }
127
+ end
125
128
  end
126
129
  end
@@ -1,3 +1,3 @@
1
1
  module CucumberAnalytics
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.2'
3
3
  end
@@ -108,7 +108,7 @@ describe 'Step, Integration' do
108
108
  expected_output = ['a test step with -parameter 1- ^and@ *parameter 2!!',
109
109
  '|a block|']
110
110
 
111
- @step.step_text(with_keywords: false).should == expected_output
111
+ @step.step_text(:with_keywords => false).should == expected_output
112
112
  end
113
113
 
114
114
  end
@@ -81,7 +81,7 @@ describe 'Example, Unit' do
81
81
 
82
82
  rows = example.rows
83
83
 
84
- rows.collect { |row| row.values }.should == [['value1', 'value2'], ['value3', 'value4']]
84
+ rows.should == [{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}]
85
85
  end
86
86
 
87
87
  it 'has row elements - #row_elements' do
@@ -112,7 +112,7 @@ describe 'Example, Unit' do
112
112
  new_row = {'param1' => 'value3', 'param2' => 'value4'}
113
113
  example.add_row(new_row)
114
114
 
115
- example.rows.collect { |row| row.values }.should == [['value1', 'value2'], ['value3', 'value4']]
115
+ example.rows.should == [{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}]
116
116
  example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].should == [['value1', 'value2'], ['value3', 'value4']]
117
117
  end
118
118
 
@@ -123,7 +123,7 @@ describe 'Example, Unit' do
123
123
  new_row = ['value3', 'value4']
124
124
  example.add_row(new_row)
125
125
 
126
- example.rows.collect { |row| row.values }.should == [['value1', 'value2'], ['value3', 'value4']]
126
+ example.rows.should == [{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}]
127
127
  example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].should == [['value1', 'value2'], ['value3', 'value4']]
128
128
  end
129
129
 
@@ -142,7 +142,7 @@ describe 'Example, Unit' do
142
142
  example.add_row(hash_row)
143
143
  example.add_row(array_row)
144
144
 
145
- example.rows.collect { |row| row.values }.should == [['value1', 'value2'], ['value3', 'value4'], ['value5', 'value6']]
145
+ example.rows.should == [{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}, {'param1' => 'value5', 'param2' => 'value6'}]
146
146
  example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].should == [['value1', 'value2'], ['value3', 'value4'], ['value5', 'value6']]
147
147
  end
148
148
  end
@@ -160,7 +160,7 @@ describe 'Example, Unit' do
160
160
  old_row = {'param1' => 'value3', 'param2' => 'value4'}
161
161
  example.remove_row(old_row)
162
162
 
163
- example.rows.collect { |row| row.values }.should == [['value1', 'value2']]
163
+ example.rows.should == [{'param1' => 'value1', 'param2' => 'value2'}]
164
164
  example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].should == [['value1', 'value2']]
165
165
  end
166
166
 
@@ -171,7 +171,7 @@ describe 'Example, Unit' do
171
171
  old_row = ['value3', 'value4']
172
172
  example.remove_row(old_row)
173
173
 
174
- example.rows.collect { |row| row.values }.should == [['value1', 'value2']]
174
+ example.rows.should == [{'param1' => 'value1', 'param2' => 'value2'}]
175
175
  example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].should == [['value1', 'value2']]
176
176
  end
177
177
 
@@ -190,7 +190,7 @@ describe 'Example, Unit' do
190
190
  example.remove_row(hash_row)
191
191
  example.remove_row(array_row)
192
192
 
193
- example.rows.collect { |row| row.values }.should == [['value1', 'value2']]
193
+ example.rows.should == [{'param1' => 'value1', 'param2' => 'value2'}]
194
194
  example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].should == [['value1', 'value2']]
195
195
  end
196
196
  end
@@ -28,6 +28,14 @@ describe 'Feature, Unit' do
28
28
  @element.name.should == 'test feature'
29
29
  end
30
30
 
31
+ it 'will complain about unknown element types' do
32
+ parsed_element = {'description' => '',
33
+ 'elements' => [{'keyword' => 'Scenario', 'description' => ''},
34
+ {'keyword' => 'New Type', 'description' => ''}]}
35
+
36
+ expect { clazz.new(parsed_element) }.to raise_error(ArgumentError)
37
+ end
38
+
31
39
  it 'has a background - #background' do
32
40
  @feature.should respond_to(:background)
33
41
  end
@@ -210,25 +210,25 @@ describe 'Step, Unit' do
210
210
  it 'can provide the step\'s text without the arguments' do
211
211
  expected_output = ['Given a test step with -- ^and@ *parameter 2!!']
212
212
 
213
- @step.step_text(with_arguments: false).should == expected_output
213
+ @step.step_text(:with_arguments => false).should == expected_output
214
214
  end
215
215
 
216
216
  it 'can determine its arguments based on delimiters' do
217
217
  expected_output = ['Given a test step with -parameter 1- ^@ *parameter 2!!']
218
218
 
219
- @step.step_text(with_arguments: false, left_delimiter: '^', right_delimiter: '@').should == expected_output
219
+ @step.step_text(:with_arguments => false, :left_delimiter => '^', :right_delimiter => '@').should == expected_output
220
220
  end
221
221
 
222
222
  it 'can use delimiters of varying lengths' do
223
223
  expected_output = ['Given a test step with -parameter 1- ^and@ *!!']
224
224
 
225
- @step.step_text(with_arguments: false, left_delimiter: '*', right_delimiter: '!!').should == expected_output
225
+ @step.step_text(:with_arguments => false, :left_delimiter => '*', :right_delimiter => '!!').should == expected_output
226
226
  end
227
227
 
228
228
  it 'can handle delimiters with special regular expression characters' do
229
229
  expected_output = ['Given a test step with -parameter 1- ^and@ *!!']
230
230
 
231
- @step.step_text(with_arguments: false, left_delimiter: '*', right_delimiter: '!!').should == expected_output
231
+ @step.step_text(:with_arguments => false, :left_delimiter => '*', :right_delimiter => '!!').should == expected_output
232
232
  end
233
233
 
234
234
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-25 00:00:00.000000000 Z
11
+ date: 2014-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gherkin