cucumber_runner 0.0.1 → 0.0.2
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/Gemfile +1 -1
- data/Rakefile +8 -2
- data/bin/cucumber_runner +14 -2
- data/lib/cucumber/formatter/list_scenario_name.rb +22 -0
- data/lib/cucumber_runner/version.rb +1 -1
- data/test/test_runner.rb +27 -0
- metadata +5 -3
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/cucumber_runner
CHANGED
@@ -4,18 +4,30 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
|
7
|
+
@@names = nil
|
8
8
|
|
9
9
|
|
10
10
|
|
11
11
|
def get_cucumber_scenario_names
|
12
12
|
|
13
13
|
cmd = 'zeus cucumber' << " -d -f Cucumber::Formatter::ListScenarioName"
|
14
|
+
%x{ #{cmd} }
|
15
|
+
|
14
16
|
|
15
|
-
|
17
|
+
File.open('/tmp/cucumber_runner.tmp','r') do |f|
|
18
|
+
@@names= Marshal.load(f.read())
|
19
|
+
end
|
20
|
+
print_names
|
16
21
|
end
|
17
22
|
|
23
|
+
def print_names
|
18
24
|
|
25
|
+
@@names.each {|key,value|
|
26
|
+
puts key
|
27
|
+
value.each {|tag| puts "\t\t"<< tag }
|
28
|
+
}
|
29
|
+
|
30
|
+
end
|
19
31
|
|
20
32
|
get_cucumber_scenario_names
|
21
33
|
|
@@ -7,9 +7,11 @@ module Cucumber
|
|
7
7
|
include Io
|
8
8
|
include Console
|
9
9
|
|
10
|
+
attr_accessor :all_features, :output_file_name
|
10
11
|
def initialize(step_mother, path_or_io, options)
|
11
12
|
@io = ensure_io(path_or_io, "list_tags")
|
12
13
|
@all_features = {}
|
14
|
+
@output_file_name = '/tmp/cucumber_runner.tmp'
|
13
15
|
end
|
14
16
|
|
15
17
|
|
@@ -27,11 +29,31 @@ module Cucumber
|
|
27
29
|
|
28
30
|
|
29
31
|
def after_features(features)
|
32
|
+
|
33
|
+
self.marshale_names
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
def print_names
|
39
|
+
|
30
40
|
@all_features.each {|key,value|
|
31
41
|
@io.puts key
|
32
42
|
value.each {|tag| @io.puts "\t\t"<< tag }
|
33
43
|
}
|
44
|
+
|
34
45
|
end
|
46
|
+
def marshale_names
|
47
|
+
marshaled = Marshal.dump @all_features
|
48
|
+
|
49
|
+
File.open(@output_file_name,'wb') do |f|
|
50
|
+
f.write(marshaled)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
|
35
57
|
end
|
36
58
|
end
|
37
59
|
end
|
data/test/test_runner.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require_relative '../lib/cucumber/formatter/list_scenario_name'
|
3
|
+
|
4
|
+
|
5
|
+
class RunnerTest< Test::Unit::TestCase
|
6
|
+
|
7
|
+
|
8
|
+
def test_marshal_part
|
9
|
+
|
10
|
+
@formatter = Cucumber::Formatter::ListScenarioName.new(nil,nil,nil)
|
11
|
+
|
12
|
+
to_marshal = {"a"=>"basdfasdf","b"=>"asdfa"}
|
13
|
+
|
14
|
+
@formatter.all_features = to_marshal
|
15
|
+
@formatter.after_features nil
|
16
|
+
|
17
|
+
|
18
|
+
f = File.open(@formatter.output_file_name,'r')
|
19
|
+
loaded = Marshal.load f.read()
|
20
|
+
|
21
|
+
assert_equal loaded,to_marshal
|
22
|
+
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
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.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- lib/cucumber/formatter/list_scenario_name.rb
|
30
30
|
- lib/cucumber_runner.rb
|
31
31
|
- lib/cucumber_runner/version.rb
|
32
|
+
- test/test_runner.rb
|
32
33
|
homepage: ''
|
33
34
|
licenses: []
|
34
35
|
post_install_message:
|
@@ -49,8 +50,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
50
|
version: '0'
|
50
51
|
requirements: []
|
51
52
|
rubyforge_project:
|
52
|
-
rubygems_version: 1.8.
|
53
|
+
rubygems_version: 1.8.21
|
53
54
|
signing_key:
|
54
55
|
specification_version: 3
|
55
56
|
summary: list cucumber scenarios names, and run them
|
56
|
-
test_files:
|
57
|
+
test_files:
|
58
|
+
- test/test_runner.rb
|