chemistrykit 3.7.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ # Encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require 'chemistrykit/formula/chemist_aware'
5
+
6
+ describe ChemistryKit::Formula::ChemistAware do
7
+
8
+ class StubFormula
9
+ include ChemistryKit::Formula::ChemistAware
10
+ end
11
+
12
+ before(:each) do
13
+ @stub_formula = StubFormula.new
14
+ @stub_chemist = double 'ChemistryKit::Chemist'
15
+ end
16
+
17
+ it 'should have accessors for the chemist' do
18
+ @stub_formula.chemist = @stub_chemist
19
+ @stub_formula.chemist.should be @stub_chemist
20
+ end
21
+
22
+ it 'should define a way to check if the formula is user aware' do
23
+ @stub_formula.singleton_class.include?(ChemistryKit::Formula::ChemistAware).should be_true
24
+ end
25
+ end
@@ -0,0 +1,63 @@
1
+ # Encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require 'chemistrykit/formula/formula_lab'
5
+
6
+ describe ChemistryKit::Formula::FormulaLab do
7
+
8
+ VALID_FORMULA_KEY = 'my_formula'
9
+ VALID_CHEMIST_KEY = 'admin1'
10
+ VALID_CHEMIST_TYPE = 'admin'
11
+
12
+ before(:each) do
13
+ @stub_driver = double 'Selenium::WebDriver::Driver'
14
+ @stub_repo = double 'ChemistryKit::Chemist::Repository::CsvChemistRepository', load_chemist_by_key: true, load_random_chemist_of_type: true, load_first_chemist_of_type: true
15
+ formula_path = File.join(Dir.pwd, 'spec', 'support', 'formulas')
16
+ @lab = ChemistryKit::Formula::FormulaLab.new @stub_driver, @stub_repo, formula_path
17
+ end
18
+
19
+ it 'should be initialized with a valid driver, chemist repo, and formula location' do
20
+ @lab.should be_an_instance_of ChemistryKit::Formula::FormulaLab
21
+ end
22
+
23
+ it 'should raise an error if the formula folder is not found' do
24
+ expect do
25
+ ChemistryKit::Formula::FormulaLab.new @stub_driver, @stub_repo, '/not/here'
26
+ end.to raise_error ArgumentError, 'Formula directory "/not/here" does not exist!'
27
+ end
28
+
29
+ it 'should respond to its api methods' do
30
+ @lab.should respond_to :mix
31
+ @lab.should respond_to :using
32
+ @lab.should respond_to :with
33
+ @lab.should respond_to :with_random
34
+ @lab.should respond_to :with_first
35
+ end
36
+
37
+ it 'should let the formula key be set' do
38
+ @lab.using(VALID_FORMULA_KEY)
39
+ @lab.formula.should eq VALID_FORMULA_KEY
40
+ end
41
+
42
+ it 'should set the required chemist using with' do
43
+ @lab.with(VALID_CHEMIST_KEY).should be @lab
44
+ expect(@stub_repo).to have_received(:load_chemist_by_key).with(VALID_CHEMIST_KEY)
45
+ end
46
+
47
+ it 'should set the required chemist using with_random' do
48
+ @lab.with_random(VALID_CHEMIST_TYPE).should be @lab
49
+ expect(@stub_repo).to have_received(:load_random_chemist_of_type).with(VALID_CHEMIST_TYPE)
50
+ end
51
+
52
+ it 'should set the require chemist using with_first' do
53
+ @lab.with_first(VALID_CHEMIST_TYPE).should be @lab
54
+ expect(@stub_repo).to have_received(:load_first_chemist_of_type).with(VALID_CHEMIST_TYPE)
55
+ end
56
+
57
+ it 'should raise an error if mix is called and the formula is nil' do
58
+ expect do
59
+ @lab.mix
60
+ end.to raise_error ArgumentError, 'A formula key must be defined!'
61
+ end
62
+
63
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chemistrykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-24 00:00:00.000000000 Z
13
+ date: 2013-08-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -99,7 +99,7 @@ dependencies:
99
99
  requirements:
100
100
  - - ~>
101
101
  - !ruby/object:Gem::Version
102
- version: 3.3.1
102
+ version: 3.4.0
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -107,7 +107,7 @@ dependencies:
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 3.3.1
110
+ version: 3.4.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: parallel_tests
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -156,120 +156,8 @@ dependencies:
156
156
  - - ~>
157
157
  - !ruby/object:Gem::Version
158
158
  version: 0.2.1
159
- - !ruby/object:Gem::Dependency
160
- name: rspec
161
- requirement: !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
164
- - - ~>
165
- - !ruby/object:Gem::Version
166
- version: 2.14.1
167
- type: :development
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - ~>
173
- - !ruby/object:Gem::Version
174
- version: 2.14.1
175
- - !ruby/object:Gem::Dependency
176
- name: aruba
177
- requirement: !ruby/object:Gem::Requirement
178
- none: false
179
- requirements:
180
- - - ~>
181
- - !ruby/object:Gem::Version
182
- version: 0.5.1
183
- type: :development
184
- prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
188
- - - ~>
189
- - !ruby/object:Gem::Version
190
- version: 0.5.1
191
- - !ruby/object:Gem::Dependency
192
- name: cucumber
193
- requirement: !ruby/object:Gem::Requirement
194
- none: false
195
- requirements:
196
- - - ~>
197
- - !ruby/object:Gem::Version
198
- version: 1.2.1
199
- type: :development
200
- prerelease: false
201
- version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
- requirements:
204
- - - ~>
205
- - !ruby/object:Gem::Version
206
- version: 1.2.1
207
- - !ruby/object:Gem::Dependency
208
- name: rake
209
- requirement: !ruby/object:Gem::Requirement
210
- none: false
211
- requirements:
212
- - - ~>
213
- - !ruby/object:Gem::Version
214
- version: 10.0.3
215
- type: :development
216
- prerelease: false
217
- version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
- requirements:
220
- - - ~>
221
- - !ruby/object:Gem::Version
222
- version: 10.0.3
223
- - !ruby/object:Gem::Dependency
224
- name: rubocop
225
- requirement: !ruby/object:Gem::Requirement
226
- none: false
227
- requirements:
228
- - - ~>
229
- - !ruby/object:Gem::Version
230
- version: 0.9.0
231
- type: :development
232
- prerelease: false
233
- version_requirements: !ruby/object:Gem::Requirement
234
- none: false
235
- requirements:
236
- - - ~>
237
- - !ruby/object:Gem::Version
238
- version: 0.9.0
239
- - !ruby/object:Gem::Dependency
240
- name: guard-rspec
241
- requirement: !ruby/object:Gem::Requirement
242
- none: false
243
- requirements:
244
- - - ~>
245
- - !ruby/object:Gem::Version
246
- version: 3.0.2
247
- type: :development
248
- prerelease: false
249
- version_requirements: !ruby/object:Gem::Requirement
250
- none: false
251
- requirements:
252
- - - ~>
253
- - !ruby/object:Gem::Version
254
- version: 3.0.2
255
- - !ruby/object:Gem::Dependency
256
- name: coveralls
257
- requirement: !ruby/object:Gem::Requirement
258
- none: false
259
- requirements:
260
- - - ~>
261
- - !ruby/object:Gem::Version
262
- version: 0.6.7
263
- type: :development
264
- prerelease: false
265
- version_requirements: !ruby/object:Gem::Requirement
266
- none: false
267
- requirements:
268
- - - ~>
269
- - !ruby/object:Gem::Version
270
- version: 0.6.7
271
- description: updated evidence to put in test based folders and added configuration
272
- for the retry functionality
159
+ description: Implemented the chemists feature to add user data management as well
160
+ as a simplified strategy for loading formulas
273
161
  email:
274
162
  - dave@arrgyle.com
275
163
  - jason@arrgyle.com
@@ -295,8 +183,10 @@ files:
295
183
  - TODO.md
296
184
  - bin/ckit
297
185
  - chemistrykit.gemspec
186
+ - exceptions.reek
298
187
  - features/brew.feature
299
188
  - features/catalyst.feature
189
+ - features/chemists.feature
300
190
  - features/concurrency.feature
301
191
  - features/exit_status.feature
302
192
  - features/global-config.feature
@@ -309,6 +199,8 @@ files:
309
199
  - features/tags.feature
310
200
  - lib/chemistrykit.rb
311
201
  - lib/chemistrykit/catalyst.rb
202
+ - lib/chemistrykit/chemist.rb
203
+ - lib/chemistrykit/chemist/repository/csv_chemist_repository.rb
312
204
  - lib/chemistrykit/cli/beaker.rb
313
205
  - lib/chemistrykit/cli/cli.rb
314
206
  - lib/chemistrykit/cli/formula.rb
@@ -316,11 +208,14 @@ files:
316
208
  - lib/chemistrykit/cli/new.rb
317
209
  - lib/chemistrykit/configuration.rb
318
210
  - lib/chemistrykit/formula/base.rb
211
+ - lib/chemistrykit/formula/chemist_aware.rb
212
+ - lib/chemistrykit/formula/formula_lab.rb
319
213
  - lib/chemistrykit/j_unit.rb
320
214
  - lib/chemistrykit/parallel_tests_mods.rb
321
215
  - lib/templates/beaker.tt
322
216
  - lib/templates/beaker_with_formula.tt
323
217
  - lib/templates/chemistrykit/beakers/.gitkeep
218
+ - lib/templates/chemistrykit/chemists/chemists.csv
324
219
  - lib/templates/chemistrykit/config.yaml.tt
325
220
  - lib/templates/chemistrykit/evidence/.gitkeep
326
221
  - lib/templates/chemistrykit/formulas/.gitkeep
@@ -328,12 +223,24 @@ files:
328
223
  - lib/templates/chemistrykit/formulas/lib/formula.rb
329
224
  - lib/templates/formula.tt
330
225
  - spec/integration/lib/chemistrykit/.gitkeep
226
+ - spec/integration/lib/chemistrykit/formula/formula_lab_spec.rb
331
227
  - spec/spec_helper.rb
228
+ - spec/support/bad_chemists.csv
229
+ - spec/support/chemists.csv
332
230
  - spec/support/config.yaml
231
+ - spec/support/default_chemists.csv
232
+ - spec/support/formulas/sub_module/basic_formula.rb
233
+ - spec/support/formulas/sub_module/chemist_formula.rb
234
+ - spec/support/keyless_chemists.csv
235
+ - spec/support/other_chemists.csv
333
236
  - spec/unit/lib/chemistrykit/catalyst_spec.rb
237
+ - spec/unit/lib/chemistrykit/chemist/repository/csv_chemist_repository_spec.rb
238
+ - spec/unit/lib/chemistrykit/chemist_spec.rb
334
239
  - spec/unit/lib/chemistrykit/cli/helpers/formula_loader_spec.rb
335
240
  - spec/unit/lib/chemistrykit/configuration_spec.rb
336
241
  - spec/unit/lib/chemistrykit/formula/base_spec.rb
242
+ - spec/unit/lib/chemistrykit/formula/chemist_aware_spec.rb
243
+ - spec/unit/lib/chemistrykit/formula/formula_lab_spec.rb
337
244
  homepage: https://github.com/arrgyle/chemistrykit
338
245
  licenses:
339
246
  - MIT
@@ -355,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
262
  version: '0'
356
263
  segments:
357
264
  - 0
358
- hash: -324108040210892536
265
+ hash: 4028715665356631412
359
266
  requirements: []
360
267
  rubyforge_project:
361
268
  rubygems_version: 1.8.25
@@ -366,6 +273,7 @@ summary: A simple and opinionated web testing framework for Selenium that follow
366
273
  test_files:
367
274
  - features/brew.feature
368
275
  - features/catalyst.feature
276
+ - features/chemists.feature
369
277
  - features/concurrency.feature
370
278
  - features/exit_status.feature
371
279
  - features/global-config.feature
@@ -377,9 +285,21 @@ test_files:
377
285
  - features/support/env.rb
378
286
  - features/tags.feature
379
287
  - spec/integration/lib/chemistrykit/.gitkeep
288
+ - spec/integration/lib/chemistrykit/formula/formula_lab_spec.rb
380
289
  - spec/spec_helper.rb
290
+ - spec/support/bad_chemists.csv
291
+ - spec/support/chemists.csv
381
292
  - spec/support/config.yaml
293
+ - spec/support/default_chemists.csv
294
+ - spec/support/formulas/sub_module/basic_formula.rb
295
+ - spec/support/formulas/sub_module/chemist_formula.rb
296
+ - spec/support/keyless_chemists.csv
297
+ - spec/support/other_chemists.csv
382
298
  - spec/unit/lib/chemistrykit/catalyst_spec.rb
299
+ - spec/unit/lib/chemistrykit/chemist/repository/csv_chemist_repository_spec.rb
300
+ - spec/unit/lib/chemistrykit/chemist_spec.rb
383
301
  - spec/unit/lib/chemistrykit/cli/helpers/formula_loader_spec.rb
384
302
  - spec/unit/lib/chemistrykit/configuration_spec.rb
385
303
  - spec/unit/lib/chemistrykit/formula/base_spec.rb
304
+ - spec/unit/lib/chemistrykit/formula/chemist_aware_spec.rb
305
+ - spec/unit/lib/chemistrykit/formula/formula_lab_spec.rb