recumber 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWUzNDU3M2M5MDU0MjgzZTUzMzcwMTIyNDNmNjY5ZDc0MmJkODNkYQ==
4
+ NTVlNTg5MzEwOTc4YmM4NmYyYTMwM2EzMGExZjdlYmUyYTNkNGE5ZQ==
5
5
  data.tar.gz: !binary |-
6
- ODdmNWNiMjcwY2M5ZWRjYWU2NjJjZWY0ZTMxYTA3Mjk3NmRjZTBiMA==
6
+ MWZiMjdhYzliYTY2MWQyY2UyMDY3NGY4MmMwMWJmZTk4MGUyYjI4MQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWRjMzk5NWJiMmYxNGFiMDQwYTYxMTVmZDFlNTEwZmJhNWUxMzZlNDQyMWRi
10
- MzM0YmNiZmQzYTM4N2QzMDdiOWM2Mjg0Yzk0NjcyNzg5MTUzNjMyNzljM2Iy
11
- OWY1YmRhMjZmYWQ1ZGI1NzMwYTBmYzY1M2RhN2E2YzJlMzU5ODI=
9
+ YmNlNzU0NzYzMzNkODY0MTliNDMzOTBlZjVhZTcxOTYyZDIzYjEwZTA3YjRm
10
+ N2UzMTU0NTVmYjNmMzI1MmM2NmEzM2ExZDk4OGY4MDk3NDBjNzY2MzdlOTdj
11
+ ZjA4MTJmYmZkMzdkMDk3MjdjNTg3ODQ5NTNmNDMwNjE4ODMzMjM=
12
12
  data.tar.gz: !binary |-
13
- ZTljODY2NjYzMDY4N2FiNDczZjlhMjFiNWM2NWFiZTJjMWY0ODZkOTg4YWVh
14
- NjZlZDkxOGYyMDNiZGI4NmE5MTVmMjUyMjM2OGYxNzMzNGM1NjY3MDU3MGMz
15
- MDVhOWM0OTAwMzY1MjEyZDNiMjM1N2Y3OGE1MTM0YzNlYjM1ZWY=
13
+ Mzc0NWQ1Y2ZkYmRmNmQxNjJlYzI5YjZlN2Y4ZWE0OTcxMjE0YmZmOTc5OGJl
14
+ YjI5NGY0ZTVjYzE3MTIyMzNjYjE3MzAxM2IzN2I5Y2QwZDk2NjEyZmQ5ZjJk
15
+ MTg2ZmY5NjM2YTU5N2UyYWMwNWY0MjdjYjc2NGNlNTIyYWI0OTg=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- recumber (0.0.1)
4
+ recumber (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -4,9 +4,7 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
4
4
 
5
5
  require 'recumber'
6
6
 
7
- options = {}
8
-
9
- parse_command_line_args
7
+ options = parse_command_line_args
10
8
 
11
9
  cuke_log_path = "log/cucumber/last_run.log"
12
10
 
@@ -26,7 +24,7 @@ if cuke_input.length > 0
26
24
  print_no_failures_message
27
25
  else
28
26
  print_rerun_message failed_features
29
- CucumberRunner.rerun_features failed_features
27
+ CucumberRunner.rerun_features(failed_features, options)
30
28
  end
31
29
  else
32
30
  puts "Incorrect usage!"
@@ -7,6 +7,8 @@ def read_piped_input
7
7
  end
8
8
 
9
9
  def parse_command_line_args
10
+ options_hash = {}
11
+
10
12
  option_parser = OptionParser.new do |option|
11
13
  option.banner = "Usage: recumber COMMAND [OPTIONS]"
12
14
  option.separator ""
@@ -15,7 +17,7 @@ def parse_command_line_args
15
17
  option.separator "Options"
16
18
 
17
19
  option.on("-z","--zeus","Rerun the failing steps under Zeus") do
18
- options[:zeus] = true
20
+ options_hash[:zeus] = true
19
21
  end
20
22
 
21
23
  option.on("-h","--help","help") do
@@ -24,6 +26,7 @@ def parse_command_line_args
24
26
  end
25
27
 
26
28
  option_parser.parse!
29
+ options_hash
27
30
  end
28
31
 
29
32
  def print_no_failures_message
@@ -1,10 +1,22 @@
1
1
  class CucumberRunner
2
2
 
3
- def self.rerun_features(feature_paths)
4
- command = "cucumber #{feature_paths.join(' ')}"
3
+ def self.rerun_features(feature_paths, options)
4
+ command = get_command_from_options(options)
5
+ command << " " << feature_paths.join(' ')
6
+
5
7
  puts "Recumber command: #{command}"
6
8
 
7
9
  system(command)
8
10
  end
9
11
 
12
+ private
13
+
14
+ def self.get_command_from_options(options)
15
+ if options[:zeus]
16
+ command = "zeus cucumber"
17
+ else
18
+ command = "cucumber"
19
+ end
20
+ end
21
+
10
22
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "recumber"
7
- s.version = "0.0.2"
7
+ s.version = "0.0.3"
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Todd Mohney"]
10
10
  s.email = ["toddmohney@gmail.com"]
@@ -7,9 +7,22 @@ describe CucumberRunner do
7
7
  let(:system) { double }
8
8
 
9
9
 
10
- it "calls 'system' with the joined array" do
11
- CucumberRunner.should_receive(:system).with("cucumber cmd_1 cmd_2")
12
- CucumberRunner.rerun_features(feature_paths)
10
+ context "with no options specified" do
11
+ let(:options) { {} }
12
+
13
+ it "calls 'system' with the joined array" do
14
+ CucumberRunner.should_receive(:system).with("cucumber cmd_1 cmd_2")
15
+ CucumberRunner.rerun_features(feature_paths, options)
16
+ end
17
+ end
18
+
19
+ context "with zeus specified in the options hash" do
20
+ let(:options) { { zeus: true } }
21
+
22
+ it "calls 'system' with the joined array" do
23
+ CucumberRunner.should_receive(:system).with("zeus cucumber cmd_1 cmd_2")
24
+ CucumberRunner.rerun_features(feature_paths, options)
25
+ end
13
26
  end
14
27
  end
15
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Mohney
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-20 00:00:00.000000000 Z
11
+ date: 2013-05-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Automatically re-runs failed cucumber features.
14
14
  email: