multicuke 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,6 +79,9 @@ module Multicuke
79
79
  # Optional. If true will generate index file but not launch processes. Used for testing.
80
80
  attr_accessor :dry_run
81
81
 
82
+ # Add cucumber --require option load *.rb files under features root path by default unless specified to false.
83
+ attr_accessor :require_features_root_option
84
+
82
85
  # Delegate to a wrapper of system call in order mock/test
83
86
  attr_accessor :system_command
84
87
 
@@ -86,6 +89,7 @@ module Multicuke
86
89
  yield self if block_given?
87
90
 
88
91
  @dry_run = false if dry_run.nil?
92
+ @require_features_root_option = true if require_features_root_option.nil?
89
93
  @output_dir_name = "cucumber_reports" unless output_dir_name
90
94
  @output_path = "" unless output_path
91
95
  @excluded_dirs = [] unless excluded_dirs
@@ -112,7 +116,8 @@ module Multicuke
112
116
  feature_full_path = File.join(features_root_path, "#{features_dir.name}")
113
117
  fork {
114
118
  main_command = %W[bundle exec cucumber #{feature_full_path}]
115
- options = %W[-r #{features_root_path} --format html --out #{report_file_path}]
119
+ options = %W[--format html --out #{report_file_path}]
120
+ options.concat %W[--require #{features_root_path}] if require_features_root_option
116
121
  full_command = main_command + options + extra_options
117
122
  result = system_command.run full_command
118
123
  puts "Features '#{features_dir.name}' finished. #{result ? 'SUCCESS' : 'FAILURE'} (pid: #{Process.pid})"
@@ -151,6 +156,8 @@ module Multicuke
151
156
  }.map { |feature_path|
152
157
  dir_name = File.basename(File.dirname(feature_path))
153
158
  FeaturesDir.new(dir_name)
159
+ }.uniq { |feature_dir|
160
+ feature_dir.name
154
161
  }
155
162
  end
156
163
 
@@ -1,3 +1,3 @@
1
1
  module Multicuke
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.8"
3
3
  end
data/multicuke.gemspec CHANGED
@@ -13,4 +13,9 @@ Gem::Specification.new do |gem|
13
13
  gem.name = "multicuke"
14
14
  gem.require_paths = ["lib"]
15
15
  gem.version = Multicuke::VERSION
16
+
17
+ gem.add_dependency 'cucumber'
18
+ gem.add_dependency 'rspec'
19
+ gem.add_dependency 'nokogiri'
20
+
16
21
  end
@@ -0,0 +1,7 @@
1
+ Feature: Division of other numbers
2
+
3
+ Scenario: Divide 2 other numbers
4
+ Given a first number 6
5
+ And a second number 3
6
+ When I divide them
7
+ Then I get 2
data/spec/fork_spec.rb CHANGED
@@ -25,6 +25,15 @@ module Multicuke
25
25
 
26
26
  File.open("#{RESULTS_DIR_PATH}/cucumber_reports/index.html") { |file|
27
27
  content = file.read
28
+ content.should match /.*<a href="addition.html">Addition<\/a>.*/
29
+ content.should match /.*<a href="substraction.html">Substraction<\/a>.*/
30
+ content.should match /.*<a href="division.html">Division<\/a>.*/
31
+ content.should match /.*<a href="bad_addition.html">Bad addition<\/a>.*/
32
+ content.should match /.*<a href="multiplication.html">Multiplication<\/a>.*/
33
+
34
+ division_sections = content.scan(/(<a href="division.html">Division<\/a>)/)
35
+ division_sections.should have(1).items
36
+
28
37
  content.should match /.*Scenarios: 1 failed, Steps: 1 failed, 3 passed.*/i
29
38
  }
30
39
  end
data/spec/runner_spec.rb CHANGED
@@ -9,6 +9,7 @@ module Multicuke
9
9
  r.output_dir_name = "my_reports"
10
10
  r.output_path = "my_output_path"
11
11
  r.dry_run = true
12
+ r.require_features_root_option = false
12
13
  r.excluded_dirs = ["my_first_dir", "my_second_dir"]
13
14
  r.extra_options = ["-p", "profile"]
14
15
  end
@@ -17,6 +18,7 @@ module Multicuke
17
18
  runner.output_dir_name.should == "my_reports"
18
19
  runner.output_path.should == "my_output_path"
19
20
  runner.dry_run.should be_true
21
+ runner.require_features_root_option.should be_false
20
22
  runner.excluded_dirs.should include("my_first_dir", "my_second_dir")
21
23
  runner.extra_options.should include("-p", "profile")
22
24
  end
@@ -27,6 +29,7 @@ module Multicuke
27
29
  runner.output_dir_name.should == "cucumber_reports"
28
30
  runner.output_path.should == ""
29
31
  runner.dry_run.should be_false
32
+ runner.require_features_root_option.should be_true
30
33
  runner.excluded_dirs.should be_empty
31
34
  runner.extra_options.should be_empty
32
35
  end
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.6
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,55 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-04-04 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cucumber
16
+ requirement: !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: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: nokogiri
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
14
62
  description: Run your features faster
15
63
  email:
16
64
  executables: []
@@ -31,6 +79,7 @@ files:
31
79
  - spec/features/addition/add_numbers.feature
32
80
  - spec/features/bad_addition/bad_addition.feature
33
81
  - spec/features/division/divide_numbers.feature
82
+ - spec/features/division/divide_other_numbers.feature
34
83
  - spec/features/empty/empty_file.feature
35
84
  - spec/features/exclude_me_features/non_important.feature
36
85
  - spec/features/multiplication/multiply_numbers.feature
@@ -71,6 +120,7 @@ test_files:
71
120
  - spec/features/addition/add_numbers.feature
72
121
  - spec/features/bad_addition/bad_addition.feature
73
122
  - spec/features/division/divide_numbers.feature
123
+ - spec/features/division/divide_other_numbers.feature
74
124
  - spec/features/empty/empty_file.feature
75
125
  - spec/features/exclude_me_features/non_important.feature
76
126
  - spec/features/multiplication/multiply_numbers.feature