viewcumber 0.2.2 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/build/Application.js +2 -2
- data/lib/viewcumber.rb +31 -32
- data/src/FeatureFile.j +2 -2
- data/viewcumber.gemspec +13 -11
- metadata +49 -22
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.authors = ["gregbell", "pcreux", "samuelreh"]
|
11
11
|
gem.default_executable = "viewcumber"
|
12
12
|
gem.executables = ["viewcumber"]
|
13
|
-
gem.add_dependency "cucumber", ">=
|
13
|
+
gem.add_dependency "cucumber", ">= 1.1.4"
|
14
14
|
gem.add_dependency "capybara", ">= 0.3"
|
15
15
|
end
|
16
16
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.1
|
data/build/Application.js
CHANGED
@@ -36001,8 +36001,8 @@ return objj_msgSend(_scenarios,"count");
|
|
36001
36001
|
class_addMethods(_373e,[new objj_method(sel_getUid("featureFilesFromCucumberJSON:"),function(_374b,_374c,_374d){
|
36002
36002
|
with(_374b){
|
36003
36003
|
var _374e=objj_msgSend(CPArray,"arrayWithArray:",[]);
|
36004
|
-
for(var i=0;i<_374d.
|
36005
|
-
objj_msgSend(_374e,"addObject:",objj_msgSend(FeatureFile,"featureFileFromCucumberJSON:",_374d
|
36004
|
+
for(var i=0;i<_374d.length;i++){
|
36005
|
+
objj_msgSend(_374e,"addObject:",objj_msgSend(FeatureFile,"featureFileFromCucumberJSON:",_374d[i]));
|
36006
36006
|
}
|
36007
36007
|
return _374e;
|
36008
36008
|
}
|
data/lib/viewcumber.rb
CHANGED
@@ -22,43 +22,17 @@ if respond_to? :AfterStep
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class Viewcumber < Cucumber::Formatter::Json
|
25
|
-
module Cucumber09
|
26
|
-
def after_step(step)
|
27
|
-
@current_step[:html_file] = write_html_to_file(Viewcumber.last_step_html)
|
28
|
-
@current_step[:emails] = emails_for_step(step)
|
29
|
-
super
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
module Cucumber010
|
34
|
-
def after_step(step)
|
35
|
-
additional_step_info = { 'html_file' => write_html_to_file(Viewcumber.last_step_html),
|
36
|
-
'emails' => emails_for_step(step) }
|
37
25
|
|
38
|
-
|
39
|
-
|
40
|
-
|
26
|
+
module GherkinObjectAttrs
|
27
|
+
def feature_hash
|
28
|
+
@feature_hash
|
41
29
|
end
|
42
30
|
|
43
|
-
|
44
|
-
|
45
|
-
def after_feature(feature)
|
46
|
-
if @gf.gherkin_object['elements']
|
47
|
-
@gf.gherkin_object['elements'].delete_if do |element|
|
48
|
-
element['type'] == 'background'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
super(feature)
|
31
|
+
def feature_hashes
|
32
|
+
@feature_hashes
|
52
33
|
end
|
53
34
|
end
|
54
35
|
|
55
|
-
cucumber_version = Gem.loaded_specs["cucumber"].version
|
56
|
-
if cucumber_version < Gem::Version.new('0.10.0')
|
57
|
-
include Cucumber09
|
58
|
-
else
|
59
|
-
include Cucumber010
|
60
|
-
end
|
61
|
-
|
62
36
|
class << self
|
63
37
|
attr_accessor :last_step_html
|
64
38
|
|
@@ -70,7 +44,7 @@ class Viewcumber < Cucumber::Formatter::Json
|
|
70
44
|
end
|
71
45
|
response_html.gsub!(/("|')\/(#{directories.join('|')})/, '\1public/\2')
|
72
46
|
response_html.gsub(/("|')http:\/\/.*\/images/, '\1public/images')
|
73
|
-
end
|
47
|
+
end
|
74
48
|
end
|
75
49
|
|
76
50
|
def initialize(step_mother, path_or_io, options)
|
@@ -78,8 +52,33 @@ class Viewcumber < Cucumber::Formatter::Json
|
|
78
52
|
copy_app
|
79
53
|
copy_public_folder
|
80
54
|
super(step_mother, File.open(results_filename, 'w+'), options)
|
55
|
+
@gf.extend GherkinObjectAttrs
|
81
56
|
end
|
82
57
|
|
58
|
+
def after_step(step)
|
59
|
+
|
60
|
+
additional_step_info = { 'html_file' => write_html_to_file(Viewcumber.last_step_html),
|
61
|
+
'emails' => emails_for_step(step) }
|
62
|
+
|
63
|
+
current_element = @gf.feature_hash['elements'].last
|
64
|
+
current_step = current_element['steps'].last
|
65
|
+
current_step.merge!(additional_step_info)
|
66
|
+
end
|
67
|
+
|
68
|
+
# The JSON formatter adds the background as a feature element,
|
69
|
+
# we only want full scenarios so lets delete all with type 'background'
|
70
|
+
def after_feature(feature)
|
71
|
+
# this might want to be feature_hashes and an each
|
72
|
+
if @gf.feature_hash && @gf.feature_hash['elements']
|
73
|
+
@gf.feature_hash['elements'].delete_if do |element|
|
74
|
+
element['type'] == 'background'
|
75
|
+
end
|
76
|
+
end
|
77
|
+
super(feature)
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
|
83
82
|
|
84
83
|
private
|
85
84
|
|
data/src/FeatureFile.j
CHANGED
@@ -18,8 +18,8 @@
|
|
18
18
|
{
|
19
19
|
var files = [CPArray arrayWithArray:[]];
|
20
20
|
|
21
|
-
for(var i = 0; i < json.
|
22
|
-
[files addObject:[FeatureFile featureFileFromCucumberJSON:json
|
21
|
+
for(var i = 0; i < json.length; i++) {
|
22
|
+
[files addObject:[FeatureFile featureFileFromCucumberJSON:json[i]]];
|
23
23
|
}
|
24
24
|
|
25
25
|
return files;
|
data/viewcumber.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "viewcumber"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["
|
12
|
-
s.date = "
|
11
|
+
s.authors = ["gregbell", "pcreux", "samuelreh"]
|
12
|
+
s.date = "2012-02-10"
|
13
13
|
s.executables = ["viewcumber"]
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -1789,25 +1789,27 @@ Gem::Specification.new do |s|
|
|
1789
1789
|
]
|
1790
1790
|
s.homepage = "http://github.com/versapay/viewcumber"
|
1791
1791
|
s.require_paths = ["lib"]
|
1792
|
-
s.rubygems_version = "1.8.
|
1792
|
+
s.rubygems_version = "1.8.15"
|
1793
1793
|
s.summary = "Cucumber formatter for easily viewing each step of your scenarios"
|
1794
|
-
s.test_files = [
|
1795
|
-
"test/helper.rb",
|
1796
|
-
"test/test_viewcumber.rb"
|
1797
|
-
]
|
1798
1794
|
|
1799
1795
|
if s.respond_to? :specification_version then
|
1800
1796
|
s.specification_version = 3
|
1801
1797
|
|
1802
1798
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
1803
|
-
s.add_runtime_dependency(%q<
|
1799
|
+
s.add_runtime_dependency(%q<viewcumber>, [">= 0"])
|
1800
|
+
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
1801
|
+
s.add_runtime_dependency(%q<cucumber>, [">= 1.1.4"])
|
1804
1802
|
s.add_runtime_dependency(%q<capybara>, [">= 0.3"])
|
1805
1803
|
else
|
1806
|
-
s.add_dependency(%q<
|
1804
|
+
s.add_dependency(%q<viewcumber>, [">= 0"])
|
1805
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
1806
|
+
s.add_dependency(%q<cucumber>, [">= 1.1.4"])
|
1807
1807
|
s.add_dependency(%q<capybara>, [">= 0.3"])
|
1808
1808
|
end
|
1809
1809
|
else
|
1810
|
-
s.add_dependency(%q<
|
1810
|
+
s.add_dependency(%q<viewcumber>, [">= 0"])
|
1811
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
1812
|
+
s.add_dependency(%q<cucumber>, [">= 1.1.4"])
|
1811
1813
|
s.add_dependency(%q<capybara>, [">= 0.3"])
|
1812
1814
|
end
|
1813
1815
|
end
|
metadata
CHANGED
@@ -1,44 +1,70 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viewcumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
13
|
+
- gregbell
|
14
|
+
- pcreux
|
15
|
+
- samuelreh
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date:
|
20
|
+
date: 2012-02-10 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
-
|
23
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
name: viewcumber
|
24
33
|
prerelease: false
|
25
|
-
|
34
|
+
type: :runtime
|
35
|
+
requirement: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
26
38
|
none: false
|
27
39
|
requirements:
|
28
40
|
- - ">="
|
29
41
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
42
|
+
hash: 3
|
31
43
|
segments:
|
32
44
|
- 0
|
33
|
-
|
34
|
-
|
35
|
-
|
45
|
+
version: "0"
|
46
|
+
name: jeweler
|
47
|
+
prerelease: false
|
36
48
|
type: :runtime
|
37
|
-
|
49
|
+
requirement: *id002
|
38
50
|
- !ruby/object:Gem::Dependency
|
39
|
-
|
51
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 27
|
57
|
+
segments:
|
58
|
+
- 1
|
59
|
+
- 1
|
60
|
+
- 4
|
61
|
+
version: 1.1.4
|
62
|
+
name: cucumber
|
40
63
|
prerelease: false
|
41
|
-
|
64
|
+
type: :runtime
|
65
|
+
requirement: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
42
68
|
none: false
|
43
69
|
requirements:
|
44
70
|
- - ">="
|
@@ -48,8 +74,10 @@ dependencies:
|
|
48
74
|
- 0
|
49
75
|
- 3
|
50
76
|
version: "0.3"
|
77
|
+
name: capybara
|
78
|
+
prerelease: false
|
51
79
|
type: :runtime
|
52
|
-
|
80
|
+
requirement: *id004
|
53
81
|
description:
|
54
82
|
email:
|
55
83
|
executables:
|
@@ -1859,10 +1887,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1859
1887
|
requirements: []
|
1860
1888
|
|
1861
1889
|
rubyforge_project:
|
1862
|
-
rubygems_version: 1.8.
|
1890
|
+
rubygems_version: 1.8.15
|
1863
1891
|
signing_key:
|
1864
1892
|
specification_version: 3
|
1865
1893
|
summary: Cucumber formatter for easily viewing each step of your scenarios
|
1866
|
-
test_files:
|
1867
|
-
|
1868
|
-
- test/test_viewcumber.rb
|
1894
|
+
test_files: []
|
1895
|
+
|