multicuke 0.0.8 → 0.0.9
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/lib/multicuke/runner.rb +9 -7
- data/lib/multicuke/version.rb +1 -1
- data/spec/dryrun_spec.rb +7 -6
- data/spec/fork_spec.rb +2 -2
- data/spec/runner_spec.rb +3 -5
- data/spec/system_command_spec.rb +2 -2
- metadata +2 -2
data/lib/multicuke/runner.rb
CHANGED
@@ -55,22 +55,22 @@ module Multicuke
|
|
55
55
|
# according to configuration
|
56
56
|
class Runner
|
57
57
|
|
58
|
-
# Root path to your features directory
|
58
|
+
# Root path to your features directory. Ex: your_project/features
|
59
59
|
attr_accessor :features_root_path
|
60
60
|
|
61
|
-
# Optional name for directory containing the reports
|
61
|
+
# Optional name for directory containing the reports. Default to 'cucumber_reports'
|
62
62
|
attr_accessor :output_dir_name
|
63
63
|
|
64
|
-
# Optional full path for generated reports. Default to
|
64
|
+
# Optional full path for generated reports. Default to ../{features_root_path}.
|
65
65
|
attr_accessor :output_path
|
66
66
|
|
67
|
-
# Optional features directories to exclude
|
67
|
+
# Optional regexp for name of features directories to exclude.
|
68
68
|
attr_accessor :excluded_dirs
|
69
69
|
|
70
70
|
# Optional only the features directories to be included
|
71
71
|
attr_accessor :included_only_dirs
|
72
72
|
|
73
|
-
# Array of extra options to pass to the command
|
73
|
+
# Array of extra options to pass to the command. Ex: ["-p", "my_profile", "--backtrace"]
|
74
74
|
attr_accessor :extra_options
|
75
75
|
|
76
76
|
# Full final path where html reports will be generated
|
@@ -85,13 +85,15 @@ module Multicuke
|
|
85
85
|
# Delegate to a wrapper of system call in order mock/test
|
86
86
|
attr_accessor :system_command
|
87
87
|
|
88
|
-
def initialize
|
88
|
+
def initialize(features_root)
|
89
|
+
@features_root_path = features_root
|
90
|
+
|
89
91
|
yield self if block_given?
|
90
92
|
|
91
93
|
@dry_run = false if dry_run.nil?
|
92
94
|
@require_features_root_option = true if require_features_root_option.nil?
|
93
95
|
@output_dir_name = "cucumber_reports" unless output_dir_name
|
94
|
-
@output_path = "" unless output_path
|
96
|
+
@output_path = File.expand_path("..", features_root_path) unless output_path
|
95
97
|
@excluded_dirs = [] unless excluded_dirs
|
96
98
|
@included_only_dirs = [] unless included_only_dirs
|
97
99
|
@extra_options = [] unless extra_options
|
data/lib/multicuke/version.rb
CHANGED
data/spec/dryrun_spec.rb
CHANGED
@@ -9,8 +9,8 @@ module Multicuke
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "generates index file with hyperlinks to each feature" do
|
12
|
-
|
13
|
-
|
12
|
+
features_root = File.expand_path("../features", __FILE__)
|
13
|
+
runner = Multicuke::Runner.new(features_root) do |r|
|
14
14
|
r.output_dir_name = "cuke_reports"
|
15
15
|
r.dry_run = true
|
16
16
|
r.output_path = RESULTS_DIR_PATH
|
@@ -33,8 +33,9 @@ module Multicuke
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "do not run on excluded directories and those that do not contains features" do
|
36
|
-
|
37
|
-
|
36
|
+
features_root = File.expand_path("../features", __FILE__)
|
37
|
+
runner = Multicuke::Runner.new(features_root) do |r|
|
38
|
+
r.features_root_path =
|
38
39
|
r.excluded_dirs = ["exclude_me_features"]
|
39
40
|
r.dry_run = true
|
40
41
|
r.output_path = RESULTS_DIR_PATH
|
@@ -50,8 +51,8 @@ module Multicuke
|
|
50
51
|
end
|
51
52
|
|
52
53
|
it "run on included dirs only" do
|
53
|
-
|
54
|
-
|
54
|
+
features_root = File.expand_path("../features", __FILE__)
|
55
|
+
runner = Multicuke::Runner.new(features_root) do |r|
|
55
56
|
r.included_only_dirs = ["addition"]
|
56
57
|
r.dry_run = true
|
57
58
|
r.output_path = RESULTS_DIR_PATH
|
data/spec/fork_spec.rb
CHANGED
@@ -9,8 +9,8 @@ module Multicuke
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "generates test results files" do
|
12
|
-
|
13
|
-
|
12
|
+
features_root = File.expand_path("../features", __FILE__)
|
13
|
+
runner = Multicuke::Runner.new(features_root) do |r|
|
14
14
|
r.excluded_dirs = ["steps_definition"]
|
15
15
|
r.extra_options = ["-t", "~@non_existing_tag"]
|
16
16
|
r.output_path = RESULTS_DIR_PATH
|
data/spec/runner_spec.rb
CHANGED
@@ -4,8 +4,7 @@ module Multicuke
|
|
4
4
|
|
5
5
|
describe Runner do
|
6
6
|
it "initializes with provided configuration" do
|
7
|
-
runner = Multicuke::Runner.new do |r|
|
8
|
-
r.features_root_path = "my_feature_path"
|
7
|
+
runner = Multicuke::Runner.new("my_feature_path") do |r|
|
9
8
|
r.output_dir_name = "my_reports"
|
10
9
|
r.output_path = "my_output_path"
|
11
10
|
r.dry_run = true
|
@@ -24,10 +23,9 @@ module Multicuke
|
|
24
23
|
end
|
25
24
|
|
26
25
|
it "initializes with default values" do
|
27
|
-
runner = Multicuke::Runner.new
|
28
|
-
|
26
|
+
runner = Multicuke::Runner.new(File.expand_path("../features", __FILE__))
|
29
27
|
runner.output_dir_name.should == "cucumber_reports"
|
30
|
-
runner.output_path.should
|
28
|
+
runner.output_path.should match "multicuke/spec$"
|
31
29
|
runner.dry_run.should be_false
|
32
30
|
runner.require_features_root_option.should be_true
|
33
31
|
runner.excluded_dirs.should be_empty
|
data/spec/system_command_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe "System command" do
|
4
4
|
|
5
5
|
it "runs 'bundle exec cucumber ...' command" do
|
6
|
-
|
7
|
-
|
6
|
+
features_root = File.expand_path("../features", __FILE__)
|
7
|
+
runner = Multicuke::Runner.new(features_root) do |r|
|
8
8
|
r.included_only_dirs = ["addition"]
|
9
9
|
r.output_path = RESULTS_DIR_PATH
|
10
10
|
r.system_command = mock('SystemCommand mock')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multicuke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|