cukesparse 2.0.5 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cukesparse +1 -1
- data/cukesparse.gemspec +1 -1
- data/lib/cukesparse.rb +106 -146
- data/lib/cukesparse/version.rb +1 -1
- data/spec/cukesparse/add_multiple_spec.rb +6 -6
- data/spec/cukesparse/argv_spec.rb +14 -0
- data/spec/cukesparse/check_for_parameters_spec.rb +0 -1
- data/spec/cukesparse/check_for_task_spec.rb +2 -3
- data/spec/cukesparse/debug_spec.rb +25 -0
- data/spec/cukesparse/execute_spec.rb +2 -2
- data/spec/cukesparse/load_config_spec.rb +2 -2
- data/spec/cukesparse/parse_argv_spec.rb +80 -80
- data/spec/cukesparse/reset_spec.rb +26 -0
- data/spec/cukesparse/set_cucumber_defaults_spec.rb +33 -20
- data/spec/cukesparse/set_runtime_defaults_spec.rb +28 -28
- data/spec/cukesparse/split_parameters_spec.rb +12 -12
- data/spec/fixtures/valid_tasks.yml +11 -0
- data/spec/helper.rb +2 -1
- metadata +9 -3
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe '.reset!' do
|
4
|
+
before :each do
|
5
|
+
ARGV.clear
|
6
|
+
Cukesparse.reset!
|
7
|
+
end
|
8
|
+
|
9
|
+
context "when run" do
|
10
|
+
it "will set config to be an empty hash" do
|
11
|
+
Cukesparse.config.should be_empty
|
12
|
+
end
|
13
|
+
|
14
|
+
it "will set parameters to be an empty hash" do
|
15
|
+
Cukesparse.parameters.should be_empty
|
16
|
+
end
|
17
|
+
|
18
|
+
it "will set task to be an empty hash" do
|
19
|
+
Cukesparse.task.should be_empty
|
20
|
+
end
|
21
|
+
|
22
|
+
it "will set command to be an empty array" do
|
23
|
+
Cukesparse.command.should be_empty
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -9,7 +9,7 @@ describe '.set_cucumber_defaults' do
|
|
9
9
|
context "when run with no cucumber_defaults defined" do
|
10
10
|
it "will return a warning" do
|
11
11
|
ARGV.push('no_defaults')
|
12
|
-
Cukesparse.
|
12
|
+
Cukesparse.config_file = File.join(fixture_path, 'valid_tasks.yml')
|
13
13
|
Cukesparse.load_config
|
14
14
|
Cukesparse.check_for_task
|
15
15
|
Cukesparse.should_receive("puts").with("\e[0;33;49mWARN: The task has no cucumber defaults!\e[0m")
|
@@ -17,37 +17,50 @@ describe '.set_cucumber_defaults' do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
context "when run with unknown argument passed" do
|
21
|
+
it "will return a warning" do
|
22
|
+
ARGV.push('cucumber_default_unknown', '-t', 'test')
|
23
|
+
Cukesparse.config_file = File.join(fixture_path, 'valid_tasks.yml')
|
24
|
+
Cukesparse.load_config
|
25
|
+
Cukesparse.parse_argv
|
26
|
+
Cukesparse.check_for_task
|
27
|
+
Cukesparse.check_for_parameters
|
28
|
+
Cukesparse.should_receive("puts").with("\e[0;33;49mWARN: The cucumber default testing isn't a known option!\e[0m")
|
29
|
+
Cukesparse.set_cucumber_defaults
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
20
33
|
context "when run with no arguments passed" do
|
21
34
|
before do
|
22
35
|
ARGV.push('test_task', '-t', 'test')
|
23
|
-
Cukesparse.
|
24
|
-
Cukesparse.
|
25
|
-
Cukesparse.
|
36
|
+
Cukesparse.config_file = File.join(fixture_path, 'valid_tasks.yml')
|
37
|
+
Cukesparse.load_config
|
38
|
+
Cukesparse.parse_argv
|
26
39
|
Cukesparse.check_for_task
|
27
40
|
Cukesparse.check_for_parameters
|
28
41
|
Cukesparse.set_cucumber_defaults
|
29
42
|
end
|
30
43
|
|
31
44
|
it "will have cucumber default parameters" do
|
32
|
-
Cukesparse.parameters.should have_key
|
33
|
-
Cukesparse.parameters.should have_key
|
34
|
-
Cukesparse.parameters.should have_key
|
35
|
-
Cukesparse.parameters.should have_key
|
36
|
-
Cukesparse.parameters.should have_key
|
37
|
-
Cukesparse.parameters.should have_key
|
38
|
-
Cukesparse.parameters.should have_key
|
39
|
-
Cukesparse.parameters.should have_key
|
45
|
+
Cukesparse.parameters.should have_key 'format'
|
46
|
+
Cukesparse.parameters.should have_key 'name'
|
47
|
+
Cukesparse.parameters.should have_key 'tags'
|
48
|
+
Cukesparse.parameters.should have_key 'strict'
|
49
|
+
Cukesparse.parameters.should have_key 'verbose'
|
50
|
+
Cukesparse.parameters.should have_key 'dry_run'
|
51
|
+
Cukesparse.parameters.should have_key 'guess'
|
52
|
+
Cukesparse.parameters.should have_key 'expand'
|
40
53
|
end
|
41
54
|
|
42
55
|
it "will have the expected default runtime parameter values" do
|
43
|
-
Cukesparse.parameters[
|
44
|
-
Cukesparse.parameters[
|
45
|
-
Cukesparse.parameters[
|
46
|
-
Cukesparse.parameters[
|
47
|
-
Cukesparse.parameters[
|
48
|
-
Cukesparse.parameters[
|
49
|
-
Cukesparse.parameters[
|
50
|
-
Cukesparse.parameters[
|
56
|
+
Cukesparse.parameters['format'].should eql '--format pretty'
|
57
|
+
Cukesparse.parameters['name'].should eql ['--name feature1', '--name feature2']
|
58
|
+
Cukesparse.parameters['tags'].should eql ['--tags test', '--tags tags1', '--tags tags2']
|
59
|
+
Cukesparse.parameters['strict'].should eql '--strict'
|
60
|
+
Cukesparse.parameters['verbose'].should eql '--verbose'
|
61
|
+
Cukesparse.parameters['dry_run'].should eql '--dry-run'
|
62
|
+
Cukesparse.parameters['guess'].should eql '--guess'
|
63
|
+
Cukesparse.parameters['expand'].should eql '--expand'
|
51
64
|
end
|
52
65
|
end
|
53
66
|
end
|
@@ -9,7 +9,7 @@ describe '.set_runtime_defaults' do
|
|
9
9
|
context "when run with no runtime_defaults defined" do
|
10
10
|
it "will return a warning if no runtime_defaults are provided" do
|
11
11
|
ARGV.push('no_defaults')
|
12
|
-
Cukesparse.
|
12
|
+
Cukesparse.config_file = File.join(fixture_path, 'valid_tasks.yml')
|
13
13
|
Cukesparse.load_config
|
14
14
|
Cukesparse.check_for_task
|
15
15
|
Cukesparse.should_receive("puts").with("\e[0;33;49mWARN: The task has no runtime defaults!\e[0m")
|
@@ -20,42 +20,42 @@ describe '.set_runtime_defaults' do
|
|
20
20
|
context "when run" do
|
21
21
|
before do
|
22
22
|
ARGV.push('test_task', '-t', 'test')
|
23
|
-
Cukesparse.
|
24
|
-
Cukesparse.
|
25
|
-
Cukesparse.
|
23
|
+
Cukesparse.config_file = File.join(fixture_path, 'valid_tasks.yml')
|
24
|
+
Cukesparse.load_config
|
25
|
+
Cukesparse.parse_argv
|
26
26
|
Cukesparse.check_for_task
|
27
27
|
Cukesparse.check_for_parameters
|
28
28
|
Cukesparse.set_runtime_defaults
|
29
29
|
end
|
30
30
|
|
31
31
|
it "will have runtime default parameters" do
|
32
|
-
Cukesparse.parameters.should have_key
|
33
|
-
Cukesparse.parameters.should have_key
|
34
|
-
Cukesparse.parameters.should have_key
|
35
|
-
Cukesparse.parameters.should have_key
|
36
|
-
Cukesparse.parameters.should have_key
|
37
|
-
Cukesparse.parameters.should have_key
|
38
|
-
Cukesparse.parameters.should have_key
|
39
|
-
Cukesparse.parameters.should have_key
|
40
|
-
Cukesparse.parameters.should have_key
|
41
|
-
Cukesparse.parameters.should have_key
|
42
|
-
Cukesparse.parameters.should have_key
|
43
|
-
Cukesparse.parameters.should have_key
|
32
|
+
Cukesparse.parameters.should have_key 'environment'
|
33
|
+
Cukesparse.parameters.should have_key 'log_level'
|
34
|
+
Cukesparse.parameters.should have_key 'cleanup'
|
35
|
+
Cukesparse.parameters.should have_key 'database'
|
36
|
+
Cukesparse.parameters.should have_key 'jenkins'
|
37
|
+
Cukesparse.parameters.should have_key 'retries'
|
38
|
+
Cukesparse.parameters.should have_key 'timeout'
|
39
|
+
Cukesparse.parameters.should have_key 'screenwidth'
|
40
|
+
Cukesparse.parameters.should have_key 'screenheight'
|
41
|
+
Cukesparse.parameters.should have_key 'xposition'
|
42
|
+
Cukesparse.parameters.should have_key 'yposition'
|
43
|
+
Cukesparse.parameters.should have_key 'highlight'
|
44
44
|
end
|
45
45
|
|
46
46
|
it "will have the expected default runtime parameter values" do
|
47
|
-
Cukesparse.parameters[
|
48
|
-
Cukesparse.parameters[
|
49
|
-
Cukesparse.parameters[
|
50
|
-
Cukesparse.parameters[
|
51
|
-
Cukesparse.parameters[
|
52
|
-
Cukesparse.parameters[
|
53
|
-
Cukesparse.parameters[
|
54
|
-
Cukesparse.parameters[
|
55
|
-
Cukesparse.parameters[
|
56
|
-
Cukesparse.parameters[
|
57
|
-
Cukesparse.parameters[
|
58
|
-
Cukesparse.parameters[
|
47
|
+
Cukesparse.parameters['environment'].should eql 'ENVIRONMENT=release'
|
48
|
+
Cukesparse.parameters['log_level'].should eql 'LOG_LEVEL=debug'
|
49
|
+
Cukesparse.parameters['cleanup'].should eql 'CLEANUP=true'
|
50
|
+
Cukesparse.parameters['database'].should eql 'DATABASE=true'
|
51
|
+
Cukesparse.parameters['jenkins'].should eql 'JENKINS=true'
|
52
|
+
Cukesparse.parameters['retries'].should eql 'RETRIES=5'
|
53
|
+
Cukesparse.parameters['timeout'].should eql 'TIMEOUT=60'
|
54
|
+
Cukesparse.parameters['screenwidth'].should eql 'SCREENWIDTH=1280'
|
55
|
+
Cukesparse.parameters['screenheight'].should eql 'SCREENHEIGHT=1024'
|
56
|
+
Cukesparse.parameters['xposition'].should eql 'XPOSITION=0'
|
57
|
+
Cukesparse.parameters['yposition'].should eql 'YPOSITION=0'
|
58
|
+
Cukesparse.parameters['highlight'].should eql 'HIGHLIGHT=true'
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -8,35 +8,35 @@ describe '.split_parameters' do
|
|
8
8
|
|
9
9
|
context "when run with arguments and :screen symbol" do
|
10
10
|
it "will return set a parameters screen key and value" do
|
11
|
-
Cukesparse.split_parameters('1024/1280',
|
12
|
-
Cukesparse.parameters.should have_key(
|
13
|
-
Cukesparse.parameters.should have_key(
|
14
|
-
Cukesparse.parameters[
|
15
|
-
Cukesparse.parameters[
|
11
|
+
Cukesparse.split_parameters('1024/1280', 'screen')
|
12
|
+
Cukesparse.parameters.should have_key('screenwidth')
|
13
|
+
Cukesparse.parameters.should have_key('screenheight')
|
14
|
+
Cukesparse.parameters['screenwidth'].should eql "SCREENWIDTH=1024"
|
15
|
+
Cukesparse.parameters['screenheight'].should eql "SCREENHEIGHT=1280"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
context "when run with arguments and :position symbol" do
|
20
20
|
it "will return set a parameters screen key and value" do
|
21
|
-
Cukesparse.split_parameters('0/100',
|
22
|
-
Cukesparse.parameters.should have_key(
|
23
|
-
Cukesparse.parameters.should have_key(
|
24
|
-
Cukesparse.parameters[
|
25
|
-
Cukesparse.parameters[
|
21
|
+
Cukesparse.split_parameters('0/100', 'position')
|
22
|
+
Cukesparse.parameters.should have_key('xposition')
|
23
|
+
Cukesparse.parameters.should have_key('yposition')
|
24
|
+
Cukesparse.parameters['xposition'].should eql "XPOSITION=0"
|
25
|
+
Cukesparse.parameters['yposition'].should eql "YPOSITION=100"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
context "when run with one argument" do
|
30
30
|
it "will return a you have passed enough parameters error" do
|
31
31
|
Cukesparse.should_receive("abort").with("\e[4;31;49mERROR: You have not passed enough parameters in the test command line argument!\e[0m")
|
32
|
-
Cukesparse.split_parameters('1024',
|
32
|
+
Cukesparse.split_parameters('1024', 'test')
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
context "when run with over two argument" do
|
37
37
|
it "will return a you have passed to many parameters error" do
|
38
38
|
Cukesparse.should_receive("abort").with("\e[4;31;49mERROR: You have passed to many parameters in the test command line argument!\e[0m")
|
39
|
-
Cukesparse.split_parameters('1024/1280/16',
|
39
|
+
Cukesparse.split_parameters('1024/1280/16', 'test')
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -28,6 +28,17 @@ test_task:
|
|
28
28
|
|
29
29
|
test_task1:
|
30
30
|
feature_order: ['features/featureOne', 'features/featureTwo', 'features/featureThree']
|
31
|
+
cucumber_defaults:
|
32
|
+
format: 'pretty'
|
33
|
+
runtime_defaults:
|
34
|
+
environment: 'release'
|
35
|
+
log_level: 'debug'
|
36
|
+
defaults: ['--format html', '--out coverage/report.html', '-P -s']
|
37
|
+
|
38
|
+
cucumber_default_unknown:
|
39
|
+
feature_order: ['features/featureOne', 'features/featureTwo', 'features/featureThree']
|
40
|
+
cucumber_defaults:
|
41
|
+
testing: 'pretty'
|
31
42
|
runtime_defaults:
|
32
43
|
environment: 'release'
|
33
44
|
log_level: 'debug'
|
data/spec/helper.rb
CHANGED
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: 2.
|
4
|
+
version: 2.1.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-08-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -97,11 +97,14 @@ files:
|
|
97
97
|
- lib/cukesparse.rb
|
98
98
|
- lib/cukesparse/version.rb
|
99
99
|
- spec/cukesparse/add_multiple_spec.rb
|
100
|
+
- spec/cukesparse/argv_spec.rb
|
100
101
|
- spec/cukesparse/check_for_parameters_spec.rb
|
101
102
|
- spec/cukesparse/check_for_task_spec.rb
|
103
|
+
- spec/cukesparse/debug_spec.rb
|
102
104
|
- spec/cukesparse/execute_spec.rb
|
103
105
|
- spec/cukesparse/load_config_spec.rb
|
104
106
|
- spec/cukesparse/parse_argv_spec.rb
|
107
|
+
- spec/cukesparse/reset_spec.rb
|
105
108
|
- spec/cukesparse/set_cucumber_defaults_spec.rb
|
106
109
|
- spec/cukesparse/set_runtime_defaults_spec.rb
|
107
110
|
- spec/cukesparse/split_parameters_spec.rb
|
@@ -129,17 +132,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
132
|
version: '0'
|
130
133
|
requirements: []
|
131
134
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.0.
|
135
|
+
rubygems_version: 2.0.7
|
133
136
|
signing_key:
|
134
137
|
specification_version: 4
|
135
138
|
summary: Cukesparse - cucumber command line parser
|
136
139
|
test_files:
|
137
140
|
- spec/cukesparse/add_multiple_spec.rb
|
141
|
+
- spec/cukesparse/argv_spec.rb
|
138
142
|
- spec/cukesparse/check_for_parameters_spec.rb
|
139
143
|
- spec/cukesparse/check_for_task_spec.rb
|
144
|
+
- spec/cukesparse/debug_spec.rb
|
140
145
|
- spec/cukesparse/execute_spec.rb
|
141
146
|
- spec/cukesparse/load_config_spec.rb
|
142
147
|
- spec/cukesparse/parse_argv_spec.rb
|
148
|
+
- spec/cukesparse/reset_spec.rb
|
143
149
|
- spec/cukesparse/set_cucumber_defaults_spec.rb
|
144
150
|
- spec/cukesparse/set_runtime_defaults_spec.rb
|
145
151
|
- spec/cukesparse/split_parameters_spec.rb
|