cukesparse 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cukesparse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Chrisp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-08 00:00:00.000000000 Z
11
+ date: 2013-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clik
@@ -46,7 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - lib/cukesparse.rb
49
- - test/test_cukesparse.rb
49
+ - spec/test_cukesparse.rb
50
50
  - bin/cukesparse
51
51
  homepage: https://github.com/jonathanchrisp/cukesparse
52
52
  licenses:
@@ -73,5 +73,5 @@ signing_key:
73
73
  specification_version: 4
74
74
  summary: Cukesparse - cucumber command line parser
75
75
  test_files:
76
- - test/test_cukesparse.rb
76
+ - spec/test_cukesparse.rb
77
77
  has_rdoc:
@@ -1,666 +0,0 @@
1
- require 'cukesparse'
2
- require 'colored'
3
- require 'rspec'
4
-
5
- describe "cukesparse" do
6
-
7
- # Object
8
- context "when new" do
9
- before :all do
10
- # Clear arguments as rspec passes in script path
11
- ARGV = []
12
- @cukesparse = Cukesparse.new
13
- end
14
-
15
- it "should be an instance of cukesparse" do
16
- @cukesparse.should be_an_instance_of Cukesparse
17
- end
18
-
19
- it "returns true for empty opts parameter" do
20
- @cukesparse.parameters.should be_empty
21
- end
22
-
23
- it "returns true for empty args parameter" do
24
- @cukesparse.args.should be_empty
25
- end
26
- end
27
-
28
- # Parameters
29
- context "when passed the -t parameter" do
30
- before :all do
31
- # Clear arguments as rspec passes in script path
32
- ARGV = ['test_task', '-t', 'test']
33
- @cukesparse = Cukesparse.new
34
- @cukesparse.parse_options
35
- end
36
-
37
- it "should have a parameter of tags" do
38
- @cukesparse.parameters.should have_key :tags
39
- end
40
-
41
- it "should have a tags parameter value of --tags test" do
42
- @cukesparse.parameters[:tags].should eql ['--tags test']
43
- end
44
- end
45
-
46
- context "when passed the -n parameter" do
47
- before :all do
48
- # Clear arguments as rspec passes in script path
49
- ARGV = ['test_task', '-n', 'name_test']
50
- @cukesparse = Cukesparse.new
51
- @cukesparse.parse_options
52
- end
53
-
54
- it "should have a parameter of name" do
55
- @cukesparse.parameters.should have_key :name
56
- end
57
-
58
- it "should have a tags parameter value of test" do
59
- @cukesparse.parameters[:name].should eql '--name name_test'
60
- end
61
- end
62
-
63
- context "when passed the -name parameter" do
64
- before :all do
65
- # Clear arguments as rspec passes in script path
66
- ARGV = ['test_task', '--name', 'name_test']
67
- @cukesparse = Cukesparse.new
68
- @cukesparse.parse_options
69
- end
70
-
71
- it "should have a parameter of name" do
72
- @cukesparse.parameters.should have_key :name
73
- end
74
-
75
- it "should have a tags parameter value of test" do
76
- @cukesparse.parameters[:name].should eql '--name name_test'
77
- end
78
- end
79
-
80
- context "when passed the -d parameter" do
81
- before :all do
82
- # Clear arguments as rspec passes in script path
83
- ARGV = ['test_task', '-d']
84
- @cukesparse = Cukesparse.new
85
- @cukesparse.parse_options
86
- end
87
-
88
- it "should have a parameter of name" do
89
- @cukesparse.parameters.should have_key :dry_run
90
- end
91
-
92
- it "should have a dry_run parameter value of --dry-run" do
93
- @cukesparse.parameters[:dry_run].should eql '--dry-run'
94
- end
95
- end
96
-
97
- context "when passed the --dry-run parameter" do
98
- before :all do
99
- # Clear arguments as rspec passes in script path
100
- ARGV = ['test_task', '--dry-run']
101
- @cukesparse = Cukesparse.new
102
- @cukesparse.parse_options
103
- end
104
-
105
- it "should have a parameter of dry_run" do
106
- @cukesparse.parameters.should have_key :dry_run
107
- end
108
-
109
- it "should have a dry_run parameter value of --dry-run" do
110
- @cukesparse.parameters[:dry_run].should eql '--dry-run'
111
- end
112
- end
113
-
114
- context "when passed the -v parameter" do
115
- before :all do
116
- # Clear arguments as rspec passes in script path
117
- ARGV = ['test_task', '-v']
118
- @cukesparse = Cukesparse.new
119
- @cukesparse.parse_options
120
- end
121
-
122
- it "should have a parameter of verbose" do
123
- @cukesparse.parameters.should have_key :verbose
124
- end
125
-
126
- it "should have a verbose parameter value of --verbose" do
127
- @cukesparse.parameters[:verbose].should eql '--verbose'
128
- end
129
- end
130
-
131
- context "when passed the --verbose parameter" do
132
- before :all do
133
- # Clear arguments as rspec passes in script path
134
- ARGV = ['test_task', '--verbose']
135
- @cukesparse = Cukesparse.new
136
- @cukesparse.parse_options
137
- end
138
-
139
- it "should have a parameter of verbose" do
140
- @cukesparse.parameters.should have_key :verbose
141
- end
142
-
143
- it "should have a verbose parameter value of --verbose" do
144
- @cukesparse.parameters[:verbose].should eql '--verbose'
145
- end
146
- end
147
-
148
- context "when passed the -s parameter" do
149
- before :all do
150
- # Clear arguments as rspec passes in script path
151
- ARGV = ['test_task', '-s']
152
- @cukesparse = Cukesparse.new
153
- @cukesparse.parse_options
154
- end
155
-
156
- it "should have a parameter of strict" do
157
- @cukesparse.parameters.should have_key :strict
158
- end
159
-
160
- it "should have a strict parameter value of --strict" do
161
- @cukesparse.parameters[:strict].should eql '--strict'
162
- end
163
- end
164
-
165
- context "when passed the --strict parameter" do
166
- before :all do
167
- # Clear arguments as rspec passes in script path
168
- ARGV = ['test_task', '-s']
169
- @cukesparse = Cukesparse.new
170
- @cukesparse.parse_options
171
- end
172
-
173
- it "should have a parameter of --strict" do
174
- @cukesparse.parameters.should have_key :strict
175
- end
176
-
177
- it "should have a strict parameter value of --strict" do
178
- @cukesparse.parameters[:strict].should eql '--strict'
179
- end
180
- end
181
-
182
- context "when passed the -g parameter" do
183
- before :all do
184
- # Clear arguments as rspec passes in script path
185
- ARGV = ['test_task', '-g']
186
- @cukesparse = Cukesparse.new
187
- @cukesparse.parse_options
188
- end
189
-
190
- it "should have a parameter of --guess" do
191
- @cukesparse.parameters.should have_key :guess
192
- end
193
-
194
- it "should have a strict parameter value of --guess" do
195
- @cukesparse.parameters[:guess].should eql '--guess'
196
- end
197
- end
198
-
199
- context "when passed the --guess parameter" do
200
- before :all do
201
- # Clear arguments as rspec passes in script path
202
- ARGV = ['test_task', '--guess']
203
- @cukesparse = Cukesparse.new
204
- @cukesparse.parse_options
205
- end
206
-
207
- it "should have a parameter of --guess" do
208
- @cukesparse.parameters.should have_key :guess
209
- end
210
-
211
- it "should have a strict parameter value of --guess" do
212
- @cukesparse.parameters[:guess].should eql '--guess'
213
- end
214
- end
215
-
216
- context "when passed the -x parameter" do
217
- before :all do
218
- # Clear arguments as rspec passes in script path
219
- ARGV = ['test_task', '-x']
220
- @cukesparse = Cukesparse.new
221
- @cukesparse.parse_options
222
- end
223
-
224
- it "should have a parameter of --expand" do
225
- @cukesparse.parameters.should have_key :expand
226
- end
227
-
228
- it "should have a strict parameter value of --expand" do
229
- @cukesparse.parameters[:expand].should eql '--expand'
230
- end
231
- end
232
-
233
- context "when passed the --expand parameter" do
234
- before :all do
235
- # Clear arguments as rspec passes in script path
236
- ARGV = ['test_task', '--expand']
237
- @cukesparse = Cukesparse.new
238
- @cukesparse.parse_options
239
- end
240
-
241
- it "should have a parameter of --expand" do
242
- @cukesparse.parameters.should have_key :expand
243
- end
244
-
245
- it "should have a strict parameter value of --expand" do
246
- @cukesparse.parameters[:expand].should eql '--expand'
247
- end
248
- end
249
-
250
- context "when passed the -e parameter" do
251
- before :all do
252
- # Clear arguments as rspec passes in script path
253
- ARGV = ['test_task', '-e', 'test_environment']
254
- @cukesparse = Cukesparse.new
255
- @cukesparse.parse_options
256
- end
257
-
258
- it "should have a parameter of environment" do
259
- @cukesparse.parameters.should have_key :environment
260
- end
261
-
262
- it "should have a environment parameter value of ENVIRONMENT=test_environment" do
263
- @cukesparse.parameters[:environment].should eql 'ENVIRONMENT=test_environment'
264
- end
265
- end
266
-
267
- context "when passed the --environment parameter" do
268
- before :all do
269
- # Clear arguments as rspec passes in script path
270
- ARGV = ['test_task', '--environment', 'test_environment']
271
- @cukesparse = Cukesparse.new
272
- @cukesparse.parse_options
273
- end
274
-
275
- it "should have a parameter of environment" do
276
- @cukesparse.parameters.should have_key :environment
277
- end
278
-
279
- it "should have a environment parameter value of ENVIRONMENT=test_environment" do
280
- @cukesparse.parameters[:environment].should eql 'ENVIRONMENT=test_environment'
281
- end
282
- end
283
-
284
- context "when passed the -l parameter" do
285
- before :all do
286
- # Clear arguments as rspec passes in script path
287
- ARGV = ['test_task', '-l', 'debug']
288
- @cukesparse = Cukesparse.new
289
- @cukesparse.parse_options
290
- end
291
-
292
- it "should have a parameter of loglevel" do
293
- @cukesparse.parameters.should have_key :log_level
294
- end
295
-
296
- it "should have a loglevel parameter value of LOG_LEVEL=debug" do
297
- @cukesparse.parameters[:log_level].should eql 'LOG_LEVEL=debug'
298
- end
299
- end
300
-
301
- context "when passed the --loglevel parameter" do
302
- before :all do
303
- # Clear arguments as rspec passes in script path
304
- ARGV = ['test_task', '--loglevel', 'debug']
305
- @cukesparse = Cukesparse.new
306
- @cukesparse.parse_options
307
- end
308
-
309
- it "should have a parameter of loglevel" do
310
- @cukesparse.parameters.should have_key :log_level
311
- end
312
-
313
- it "should have a loglevel parameter value of LOG_LEVEL=debug" do
314
- @cukesparse.parameters[:log_level].should eql 'LOG_LEVEL=debug'
315
- end
316
- end
317
-
318
- context "when passed the -c parameter" do
319
- before :all do
320
- # Clear arguments as rspec passes in script path
321
- ARGV = ['test_task', '-c', 'browser']
322
- @cukesparse = Cukesparse.new
323
- @cukesparse.parse_options
324
- end
325
-
326
- it "should have a parameter of controller" do
327
- @cukesparse.parameters.should have_key :controller
328
- end
329
-
330
- it "should have a controller parameter value of CONTROLLER=browser" do
331
- @cukesparse.parameters[:controller].should eql 'CONTROLLER=browser'
332
- end
333
- end
334
-
335
- context "when passed the --controller parameter" do
336
- before :all do
337
- # Clear arguments as rspec passes in script path
338
- ARGV = ['test_task', '--controller', 'browser']
339
- @cukesparse = Cukesparse.new
340
- @cukesparse.parse_options
341
- end
342
-
343
- it "should have a parameter of controller" do
344
- @cukesparse.parameters.should have_key :controller
345
- end
346
-
347
- it "should have a controller parameter value of CONTROLLER=browser" do
348
- @cukesparse.parameters[:controller].should eql 'CONTROLLER=browser'
349
- end
350
- end
351
-
352
- context "when passed the -h parameter" do
353
- before :all do
354
- # Clear arguments as rspec passes in script path
355
- ARGV = ['test_task', '-h']
356
- @cukesparse = Cukesparse.new
357
- @cukesparse.parse_options
358
- end
359
-
360
- it "should have a parameter of headless" do
361
- @cukesparse.parameters.should have_key :headless
362
- end
363
-
364
- it "should have a headless parameter value of HEADLESS=TRUE" do
365
- @cukesparse.parameters[:headless].should eql 'HEADLESS=TRUE'
366
- end
367
- end
368
-
369
- context "when passed the --headless parameter" do
370
- before :all do
371
- # Clear arguments as rspec passes in script path
372
- ARGV = ['test_task', '--headless']
373
- @cukesparse = Cukesparse.new
374
- @cukesparse.parse_options
375
- end
376
-
377
- it "should have a parameter of headless" do
378
- @cukesparse.parameters.should have_key :headless
379
- end
380
-
381
- it "should have a headless parameter value of HEADLESS=TRUE" do
382
- @cukesparse.parameters[:headless].should eql 'HEADLESS=TRUE'
383
- end
384
- end
385
-
386
- context "when passed the --cleanup parameter" do
387
- before :all do
388
- # Clear arguments as rspec passes in script path
389
- ARGV = ['test_task', '--cleanup']
390
- @cukesparse = Cukesparse.new
391
- @cukesparse.parse_options
392
- end
393
-
394
- it "should have a parameter of cleanup" do
395
- @cukesparse.parameters.should have_key :cleanup
396
- end
397
-
398
- it "should have a cleanup parameter value of CLEANUP=TRUE" do
399
- @cukesparse.parameters[:cleanup].should eql 'CLEANUP=TRUE'
400
- end
401
- end
402
-
403
- context "when passed the --no-cleanup parameter" do
404
- before :all do
405
- # Clear arguments as rspec passes in script path
406
- ARGV = ['test_task', '--no-cleanup']
407
- @cukesparse = Cukesparse.new
408
- @cukesparse.parse_options
409
- end
410
-
411
- it "should have a parameter of cleanup" do
412
- @cukesparse.parameters.should have_key :cleanup
413
- end
414
-
415
- it "should have a cleanup parameter value of CLEANUP=FALSE" do
416
- @cukesparse.parameters[:cleanup].should eql 'CLEANUP=FALSE'
417
- end
418
- end
419
-
420
- context "when passed the --database parameter" do
421
- before :all do
422
- # Clear arguments as rspec passes in script path
423
- ARGV = ['test_task', '--database']
424
- @cukesparse = Cukesparse.new
425
- @cukesparse.parse_options
426
- end
427
-
428
- it "should have a parameter of database" do
429
- @cukesparse.parameters.should have_key :database
430
- end
431
-
432
- it "should have a database parameter value of DATABASE=TRUE" do
433
- @cukesparse.parameters[:database].should eql 'DATABASE=TRUE'
434
- end
435
- end
436
-
437
- context "when passed the --jenkins parameter" do
438
- before :all do
439
- # Clear arguments as rspec passes in script path
440
- ARGV = ['test_task', '--jenkins']
441
- @cukesparse = Cukesparse.new
442
- @cukesparse.parse_options
443
- end
444
-
445
- it "should have a parameter of jenkins" do
446
- @cukesparse.parameters.should have_key :jenkins
447
- end
448
-
449
- it "should have a jenkins parameter value of JENKINS=TRUE" do
450
- @cukesparse.parameters[:jenkins].should eql 'JENKINS=TRUE'
451
- end
452
- end
453
-
454
- context "when passed the --retries parameter" do
455
- before :all do
456
- # Clear arguments as rspec passes in script path
457
- ARGV = ['test_task', '--retries', '5']
458
- @cukesparse = Cukesparse.new
459
- @cukesparse.parse_options
460
- end
461
-
462
- it "should have a parameter of retries" do
463
- @cukesparse.parameters.should have_key :retries
464
- end
465
-
466
- it "should have a retries parameter value of RETRIES=5" do
467
- @cukesparse.parameters[:retries].should eql 'RETRIES=5'
468
- end
469
- end
470
-
471
- context "when passed the --timeout parameter" do
472
- before :all do
473
- # Clear arguments as rspec passes in script path
474
- ARGV = ['test_task', '--timeout', '10']
475
- @cukesparse = Cukesparse.new
476
- @cukesparse.parse_options
477
- end
478
-
479
- it "should have a parameter of timeout" do
480
- @cukesparse.parameters.should have_key :timeout
481
- end
482
-
483
- it "should have a timeout parameter value of TIMEOUT=10" do
484
- @cukesparse.parameters[:timeout].should eql 'TIMEOUT=10'
485
- end
486
- end
487
-
488
- context "when passed the --screen parameter" do
489
- before :all do
490
- # Clear arguments as rspec passes in script path
491
- ARGV = ['test_task', '--screen', '1280,1024']
492
- @cukesparse = Cukesparse.new
493
- @cukesparse.parse_options
494
- end
495
-
496
- it "should have a parameter of screen" do
497
- @cukesparse.parameters.should have_key :screen
498
- end
499
-
500
- it "should have a screen parameter value of SCREENWIDTH=1280 SCREENHEIGHT=1024" do
501
- @cukesparse.parameters[:screen].should eql 'SCREENWIDTH=1280 SCREENHEIGHT=1024'
502
- end
503
- end
504
-
505
- context "when passed the --position parameter" do
506
- before :all do
507
- # Clear arguments as rspec passes in script path
508
- ARGV = ['test_task', '--position', '0,0']
509
- @cukesparse = Cukesparse.new
510
- @cukesparse.parse_options
511
- end
512
-
513
- it "should have a parameter of position" do
514
- @cukesparse.parameters.should have_key :position
515
- end
516
-
517
- it "should have a position parameter value of XPOSITION=0 YPOSITION=0" do
518
- @cukesparse.parameters[:position].should eql 'XPOSITION=0 YPOSITION=0'
519
- end
520
- end
521
-
522
- context "when passed the --screenwidth parameter" do
523
- before :all do
524
- # Clear arguments as rspec passes in script path
525
- ARGV = ['test_task', '--screenwidth', '1280']
526
- @cukesparse = Cukesparse.new
527
- @cukesparse.parse_options
528
- end
529
-
530
- it "should have a parameter of screenwidth" do
531
- @cukesparse.parameters.should have_key :screen_width
532
- end
533
-
534
- it "should have a screenwidth parameter value of SCREENWIDTH=1280" do
535
- @cukesparse.parameters[:screen_width].should eql 'SCREENWIDTH=1280'
536
- end
537
- end
538
-
539
- context "when passed the --screenheight parameter" do
540
- before :all do
541
- # Clear arguments as rspec passes in script path
542
- ARGV = ['test_task', '--screenheight', '1024']
543
- @cukesparse = Cukesparse.new
544
- @cukesparse.parse_options
545
- end
546
-
547
- it "should have a parameter of screenheight" do
548
- @cukesparse.parameters.should have_key :screen_height
549
- end
550
-
551
- it "should have a screenheight parameter value of SCREENHEIGHT=1024" do
552
- @cukesparse.parameters[:screen_height].should eql 'SCREENHEIGHT=1024'
553
- end
554
- end
555
-
556
- context "when passed the --xposition parameter" do
557
- before :all do
558
- # Clear arguments as rspec passes in script path
559
- ARGV = ['test_task', '--xposition', '100']
560
- @cukesparse = Cukesparse.new
561
- @cukesparse.parse_options
562
- end
563
-
564
- it "should have a parameter of xposition" do
565
- @cukesparse.parameters.should have_key :xposition
566
- end
567
-
568
- it "should have a xposition parameter value of XPOSITION=100" do
569
- @cukesparse.parameters[:xposition].should eql 'XPOSITION=100'
570
- end
571
- end
572
-
573
- context "when passed the --yposition parameter" do
574
- before :all do
575
- # Clear arguments as rspec passes in script path
576
- ARGV = ['test_task', '--yposition', '100']
577
- @cukesparse = Cukesparse.new
578
- @cukesparse.parse_options
579
- end
580
-
581
- it "should have a parameter of yposition" do
582
- @cukesparse.parameters.should have_key :yposition
583
- end
584
-
585
- it "should have a yposition parameter value of YPOSITION=100" do
586
- @cukesparse.parameters[:yposition].should eql 'YPOSITION=100'
587
- end
588
- end
589
-
590
- context "when passed the -H parameter" do
591
- before :all do
592
- # Clear arguments as rspec passes in script path
593
- ARGV = ['test_task', '-H']
594
- @cukesparse = Cukesparse.new
595
- @cukesparse.parse_options
596
- end
597
-
598
- it "should have a parameter of highlight" do
599
- @cukesparse.parameters.should have_key :highlight
600
- end
601
-
602
- it "should have a highlight parameter value of HIGHLIGHT=TRUE" do
603
- @cukesparse.parameters[:highlight].should eql 'HIGHLIGHT=TRUE'
604
- end
605
- end
606
-
607
- context "when passed the --highlight parameter" do
608
- before :all do
609
- # Clear arguments as rspec passes in script path
610
- ARGV = ['test_task', '--highlight']
611
- @cukesparse = Cukesparse.new
612
- @cukesparse.parse_options
613
- end
614
-
615
- it "should have a parameter of highlight" do
616
- @cukesparse.parameters.should have_key :highlight
617
- end
618
-
619
- it "should have a highlight parameter value of HIGHLIGHT=TRUE" do
620
- @cukesparse.parameters[:highlight].should eql 'HIGHLIGHT=TRUE'
621
- end
622
- end
623
-
624
- context "when passed the --debug parameter" do
625
- before :all do
626
- # Clear arguments as rspec passes in script path
627
- ARGV = ['test_task', '--debug']
628
- @cukesparse = Cukesparse.new
629
- @cukesparse.parse_options
630
- end
631
-
632
- it "should have a parameter of debug" do
633
- @cukesparse.parameters.should have_key :debug
634
- end
635
-
636
- it "should have a debug parameter value of DEBUG=TRUE" do
637
- @cukesparse.parameters[:debug].should eql 'DEBUG=TRUE'
638
- end
639
- end
640
-
641
- # Default Parameters
642
- context "when running the test task runtime default vars should be set when no arguments passed" do
643
- before :all do
644
- # Clear arguments as rspec passes in script path
645
- # Adding test tag to prevent raise
646
- ARGV = ['test_task', '-t', 'test']
647
- @cukesparse = Cukesparse.new
648
- @cukesparse.parse_options
649
- @cukesparse.check_for_task
650
- @cukesparse.check_for_parameters
651
- end
652
-
653
- it "should have runtime default parameters" do
654
- @cukesparse.parameters.should have_key :environment
655
- @cukesparse.parameters.should have_key :log_level
656
- @cukesparse.parameters.should have_key :format
657
- end
658
-
659
- it "should have the expected default runtime parameter values" do
660
- @cukesparse.parameters[:environment].should eql 'ENVIRONMENT=release'
661
- @cukesparse.parameters[:log_level].should eql 'LOG_LEVEL=debug'
662
- @cukesparse.parameters[:format].should eql 'FORMAT=pretty'
663
- end
664
- end
665
-
666
- end