cucumber_runner 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/bin/cucumber_runner CHANGED
@@ -1,13 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
-
3
+ require 'open3'
4
4
  def display_help
5
5
  puts "cucumber_runner:
6
6
 
7
- runs cucumber scenarios by their name individully
7
+ runs cucumber scenarios by their name individually
8
8
  -h, show this help page
9
9
  --user_zeus, use zeus or not
10
10
 
11
+ set environment variables, they'll be pass to cucumber as is
12
+
11
13
  example:
12
14
  cucumber_runner ios_feature --use_zeus
13
15
 
@@ -18,6 +20,8 @@ end
18
20
  # filter the args
19
21
  def filter_args
20
22
 
23
+ #hold env variables
24
+ @env||=[]
21
25
  while arg= ARGV.shift
22
26
 
23
27
 
@@ -26,6 +30,8 @@ def filter_args
26
30
  @ask_help=true
27
31
  when "--use_zeus"
28
32
  @use_zeus=true
33
+ when /=/
34
+ @env << arg
29
35
  else
30
36
  @feature_dir = arg
31
37
  end
@@ -93,9 +99,9 @@ end
93
99
  #the heavy lifting,
94
100
  def run_cmd(cmd)
95
101
  #get continuous output
96
- IO.popen cmd do |fd|
97
- until fd.eof?
98
- puts fd.readline
102
+ Open3.popen3({"NO_LAUNCH"=>"1"},cmd) do |i,o,e|
103
+ until o.eof?
104
+ puts o.readline
99
105
  end
100
106
  end
101
107
 
@@ -104,14 +110,10 @@ end
104
110
 
105
111
 
106
112
 
107
-
108
-
109
-
110
113
  filter_args
111
114
  form_command
112
115
  get_cucumber_scenario_names
113
116
 
114
-
115
117
  while input = gets.chomp
116
118
 
117
119
 
@@ -122,7 +124,7 @@ while input = gets.chomp
122
124
  else
123
125
 
124
126
  if @@flatten_names.has_key?input
125
- cmd = "#{@zeus} cucumber #{@feature_dir} -n \"#{@@flatten_names[input]}\" "
127
+ cmd = "#{@zeus} cucumber #{@feature_dir} -n \"#{@@flatten_names[input]}\" #{@env.join(" ")} "
126
128
  puts cmd
127
129
  run_cmd cmd
128
130
  end
@@ -1,3 +1,3 @@
1
1
  module CucumberRunner
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-06-10 00:00:00.000000000 Z
12
+ date: 2013-06-11 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: list cucumber scenarios names, and run them
15
15
  email: