cuke_iterations 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -0
- data/.travis.yml +1 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +36 -0
- data/README.md +103 -0
- data/Rakefile +7 -0
- data/bin/cuke_iterations +27 -0
- data/cuke_iterations.gemspec +21 -0
- data/example/features/cuke_iterations.yml +10 -0
- data/example/features/cuking_rocks.feature +22 -0
- data/example/features/i_love_cukes.feature +25 -0
- data/example/features/support/env.rb +3 -0
- data/example/features/support/hooks.rb +4 -0
- data/lib/cuke_iterations/cucumber_helper.rb +13 -0
- data/lib/cuke_iterations/cuke_parser.rb +21 -0
- data/lib/cuke_iterations/scenario_extracting_formatter.rb +40 -0
- data/lib/cuke_iterations/scenario_list_generator.rb +12 -0
- data/lib/cuke_iterations/version.rb +3 -0
- data/lib/cuke_iterations.rb +7 -0
- data/lib/trollop.rb +782 -0
- data/spec/cuke_parser_spec.rb +55 -0
- data/spec/scenario_list_generator_spec.rb +35 -0
- data/spec/spec_helper.rb +3 -0
- metadata +83 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
include CukeIterations
|
3
|
+
|
4
|
+
describe "Extracting scenarios" do
|
5
|
+
before do
|
6
|
+
features_dir = File.join(File.dirname(__FILE__), '..', 'example', 'features')
|
7
|
+
|
8
|
+
@parsed_features = CukeParser.parse_features(features_dir)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should find all the scenarios and examples" do
|
12
|
+
expected_features = [
|
13
|
+
{filename: 'cuking_rocks.feature', line: 10},
|
14
|
+
{filename: 'cuking_rocks.feature', line: 21},
|
15
|
+
{filename: 'cuking_rocks.feature', line: 22},
|
16
|
+
{filename: 'i_love_cukes.feature', line: 4},
|
17
|
+
{filename: 'i_love_cukes.feature', line: 15},
|
18
|
+
{filename: 'i_love_cukes.feature', line: 16},
|
19
|
+
{filename: 'i_love_cukes.feature', line: 25},
|
20
|
+
]
|
21
|
+
|
22
|
+
parsed_files_with_lines = @parsed_features.map{|x| {filename: x[:filename], line: x[:line]}}
|
23
|
+
parsed_files_with_lines.should =~ expected_features
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should read scenario-level tags" do
|
27
|
+
@parsed_features.should include filename: 'i_love_cukes.feature',
|
28
|
+
line: 4,
|
29
|
+
tags: ['@tag1', '@tag2']
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should read feature-level tags on scenarios" do
|
33
|
+
@parsed_features.should include filename: 'cuking_rocks.feature',
|
34
|
+
line: 10,
|
35
|
+
tags: ['@feature_tag1', '@feature_tag2']
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should read scenario-level tags on example rows" do
|
39
|
+
@parsed_features.should include filename: 'i_love_cukes.feature',
|
40
|
+
line: 15,
|
41
|
+
tags: ['@tag3', '@tag4']
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should read feature-level tags on example rows" do
|
45
|
+
@parsed_features.should include filename: 'cuking_rocks.feature',
|
46
|
+
line: 21,
|
47
|
+
tags: ['@feature_tag1', '@feature_tag2']
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should read example-group tags on example rows" do
|
51
|
+
@parsed_features.should include filename: 'i_love_cukes.feature',
|
52
|
+
line: 25,
|
53
|
+
tags: ['@tag5', '@tag6', '@tag7', '@tag8']
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Scenario list generator" do
|
4
|
+
before do
|
5
|
+
@parsed_features = [
|
6
|
+
@test1 = {filename: 'cuking_rocks.feature', line: 10, tags: ['@tag3', '@tag4']},
|
7
|
+
@test2 = {filename: 'cuking_rocks.feature', line: 14, tags: ['@tag2', '@tag9']},
|
8
|
+
@test3 = {filename: 'cuking_rocks.feature', line: 18, tags: ['@tag3', '@tag8']},
|
9
|
+
]
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should include the scenarios that have tags specified in the iteration" do
|
13
|
+
iteration = {
|
14
|
+
name: "iphone",
|
15
|
+
include_tags: ['@tag2', '@tag8'],
|
16
|
+
exclude_tags: []
|
17
|
+
}
|
18
|
+
|
19
|
+
list = ScenarioListGenerator.for_iteration(@parsed_features, iteration)
|
20
|
+
|
21
|
+
list.should =~ [@test2, @test3]
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should exclude scenarios that the iteration specifies to exclude" do
|
25
|
+
iteration = {
|
26
|
+
name: "android",
|
27
|
+
include_tags: ['@tag3'],
|
28
|
+
exclude_tags: ['@tag8'],
|
29
|
+
}
|
30
|
+
|
31
|
+
list = ScenarioListGenerator.for_iteration(@parsed_features, iteration)
|
32
|
+
|
33
|
+
list.should =~ [@test1]
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cuke_iterations
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jon Merrifield
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-08-27 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gherkin
|
16
|
+
requirement: &2155927060 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2155927060
|
25
|
+
description: Run your Cucumber features multiple times within one Cucumber invocation
|
26
|
+
email:
|
27
|
+
- jon@jmerrifield.com
|
28
|
+
executables:
|
29
|
+
- cuke_iterations
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- .gitignore
|
34
|
+
- .travis.yml
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
37
|
+
- README.md
|
38
|
+
- Rakefile
|
39
|
+
- bin/cuke_iterations
|
40
|
+
- cuke_iterations.gemspec
|
41
|
+
- example/features/cuke_iterations.yml
|
42
|
+
- example/features/cuking_rocks.feature
|
43
|
+
- example/features/i_love_cukes.feature
|
44
|
+
- example/features/support/env.rb
|
45
|
+
- example/features/support/hooks.rb
|
46
|
+
- lib/cuke_iterations.rb
|
47
|
+
- lib/cuke_iterations/cucumber_helper.rb
|
48
|
+
- lib/cuke_iterations/cuke_parser.rb
|
49
|
+
- lib/cuke_iterations/scenario_extracting_formatter.rb
|
50
|
+
- lib/cuke_iterations/scenario_list_generator.rb
|
51
|
+
- lib/cuke_iterations/version.rb
|
52
|
+
- lib/trollop.rb
|
53
|
+
- spec/cuke_parser_spec.rb
|
54
|
+
- spec/scenario_list_generator_spec.rb
|
55
|
+
- spec/spec_helper.rb
|
56
|
+
homepage: https://github.com/jmerrifield/cuke_iterations
|
57
|
+
licenses: []
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project: cuke_iterations
|
76
|
+
rubygems_version: 1.8.6
|
77
|
+
signing_key:
|
78
|
+
specification_version: 3
|
79
|
+
summary: Multiple iterations for Cucumber features
|
80
|
+
test_files:
|
81
|
+
- spec/cuke_parser_spec.rb
|
82
|
+
- spec/scenario_list_generator_spec.rb
|
83
|
+
- spec/spec_helper.rb
|