cuke_profiles 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -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_profiles +27 -0
- data/cuke_profiles.gemspec +21 -0
- data/example/features/cuke_profiles.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_profiles.rb +7 -0
- data/lib/cuke_profiles/cucumber_helper.rb +13 -0
- data/lib/cuke_profiles/cuke_parser.rb +21 -0
- data/lib/cuke_profiles/scenario_extracting_formatter.rb +40 -0
- data/lib/cuke_profiles/scenario_list_generator.rb +12 -0
- data/lib/cuke_profiles/version.rb +3 -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 CukeProfiles
|
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 profile" do
|
13
|
+
profile = {
|
14
|
+
name: "iphone",
|
15
|
+
include_tags: ['@tag2', '@tag8'],
|
16
|
+
exclude_tags: []
|
17
|
+
}
|
18
|
+
|
19
|
+
list = ScenarioListGenerator.for_profile(@parsed_features, profile)
|
20
|
+
|
21
|
+
list.should =~ [@test2, @test3]
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should exclude scenarios that the profile specifies to exclude" do
|
25
|
+
profile = {
|
26
|
+
name: "android",
|
27
|
+
include_tags: ['@tag3'],
|
28
|
+
exclude_tags: ['@tag8'],
|
29
|
+
}
|
30
|
+
|
31
|
+
list = ScenarioListGenerator.for_profile(@parsed_features, profile)
|
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_profiles
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jon Merrifield
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-08-26 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gherkin
|
16
|
+
requirement: &2157025620 !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: *2157025620
|
25
|
+
description: Run your Cucumber features multiple times within one Cucumber invocation
|
26
|
+
email:
|
27
|
+
- jon@jmerrifield.com
|
28
|
+
executables:
|
29
|
+
- cuke_profiles
|
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_profiles
|
40
|
+
- cuke_profiles.gemspec
|
41
|
+
- example/features/cuke_profiles.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_profiles.rb
|
47
|
+
- lib/cuke_profiles/cucumber_helper.rb
|
48
|
+
- lib/cuke_profiles/cuke_parser.rb
|
49
|
+
- lib/cuke_profiles/scenario_extracting_formatter.rb
|
50
|
+
- lib/cuke_profiles/scenario_list_generator.rb
|
51
|
+
- lib/cuke_profiles/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_profiles
|
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_profiles
|
76
|
+
rubygems_version: 1.8.6
|
77
|
+
signing_key:
|
78
|
+
specification_version: 3
|
79
|
+
summary: Multiple profiles for Cucumber features
|
80
|
+
test_files:
|
81
|
+
- spec/cuke_parser_spec.rb
|
82
|
+
- spec/scenario_list_generator_spec.rb
|
83
|
+
- spec/spec_helper.rb
|