viewcumber 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.rdoc +6 -2
- data/VERSION +1 -1
- data/lib/viewcumber.rb +34 -5
- data/viewcumber.gemspec +4 -4
- metadata +3 -11
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -5,7 +5,7 @@ A Cucumber formatter which generates an HTML website to browse your scenarios an
|
|
5
5
|
== Pre-requisites
|
6
6
|
|
7
7
|
* Rails 3
|
8
|
-
* Cucumber (0.8.5
|
8
|
+
* Cucumber (0.8.5 and greater)
|
9
9
|
* Capybara
|
10
10
|
|
11
11
|
== Installation
|
@@ -26,7 +26,7 @@ Then open ./viewcumber/index.html in Firefox/Safari. It does not work in Chrome.
|
|
26
26
|
|
27
27
|
== Screenshots
|
28
28
|
|
29
|
-
|
29
|
+
http://github.com/versapay/viewcumber/raw/master/screenshot.png
|
30
30
|
|
31
31
|
== Note on Patches/Pull Requests
|
32
32
|
|
@@ -38,6 +38,10 @@ Then open ./viewcumber/index.html in Firefox/Safari. It does not work in Chrome.
|
|
38
38
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
39
39
|
* Send me a pull request. Bonus points for topic branches.
|
40
40
|
|
41
|
+
== License
|
42
|
+
|
43
|
+
MIT
|
44
|
+
|
41
45
|
== Copyright
|
42
46
|
|
43
47
|
Copyright (c) 2010 Versapay. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/viewcumber.rb
CHANGED
@@ -20,6 +20,40 @@ if respond_to? :AfterStep
|
|
20
20
|
end
|
21
21
|
|
22
22
|
class Viewcumber < Cucumber::Formatter::Json
|
23
|
+
module Cucumber09
|
24
|
+
def after_step(step)
|
25
|
+
@current_step[:html_file] = write_html_to_file(Viewcumber.last_step_html)
|
26
|
+
@current_step[:emails] = emails_for_step(step)
|
27
|
+
super
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module Cucumber010
|
32
|
+
def after_step(step)
|
33
|
+
additional_step_info = { 'html_file' => write_html_to_file(Viewcumber.last_step_html),
|
34
|
+
'emails' => emails_for_step(step) }
|
35
|
+
|
36
|
+
current_element = @gf.gherkin_object['elements'].last
|
37
|
+
current_step = current_element['steps'].last
|
38
|
+
current_step.merge!(additional_step_info)
|
39
|
+
end
|
40
|
+
|
41
|
+
# The JSON formatter adds the background as a feature element,
|
42
|
+
# we only want full scenarios so lets delete all with type 'background'
|
43
|
+
def after_feature(feature)
|
44
|
+
@gf.gherkin_object['elements'].delete_if do |element|
|
45
|
+
element['type'] == 'background'
|
46
|
+
end
|
47
|
+
super(feature)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
cucumber_version = Gem.loaded_specs["cucumber"].version
|
52
|
+
if cucumber_version < Gem::Version.new('0.10.0')
|
53
|
+
include Cucumber09
|
54
|
+
else
|
55
|
+
include Cucumber010
|
56
|
+
end
|
23
57
|
|
24
58
|
class << self
|
25
59
|
attr_accessor :last_step_html
|
@@ -42,11 +76,6 @@ class Viewcumber < Cucumber::Formatter::Json
|
|
42
76
|
super(step_mother, File.open(results_filename, 'w+'), options)
|
43
77
|
end
|
44
78
|
|
45
|
-
def after_step(step)
|
46
|
-
@current_step[:html_file] = write_html_to_file(Viewcumber.last_step_html)
|
47
|
-
@current_step[:emails] = emails_for_step(step)
|
48
|
-
super
|
49
|
-
end
|
50
79
|
|
51
80
|
private
|
52
81
|
|
data/viewcumber.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{viewcumber}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["gregbell", "pcreux", "samuelreh"]
|
@@ -1800,14 +1800,14 @@ Gem::Specification.new do |s|
|
|
1800
1800
|
s.specification_version = 3
|
1801
1801
|
|
1802
1802
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
1803
|
-
s.add_runtime_dependency(%q<cucumber>, [">= 0.8.5"
|
1803
|
+
s.add_runtime_dependency(%q<cucumber>, [">= 0.8.5"])
|
1804
1804
|
s.add_runtime_dependency(%q<capybara>, [">= 0.3"])
|
1805
1805
|
else
|
1806
|
-
s.add_dependency(%q<cucumber>, [">= 0.8.5"
|
1806
|
+
s.add_dependency(%q<cucumber>, [">= 0.8.5"])
|
1807
1807
|
s.add_dependency(%q<capybara>, [">= 0.3"])
|
1808
1808
|
end
|
1809
1809
|
else
|
1810
|
-
s.add_dependency(%q<cucumber>, [">= 0.8.5"
|
1810
|
+
s.add_dependency(%q<cucumber>, [">= 0.8.5"])
|
1811
1811
|
s.add_dependency(%q<capybara>, [">= 0.3"])
|
1812
1812
|
end
|
1813
1813
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viewcumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- gregbell
|
@@ -34,14 +34,6 @@ dependencies:
|
|
34
34
|
- 8
|
35
35
|
- 5
|
36
36
|
version: 0.8.5
|
37
|
-
- - <
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
hash: 55
|
40
|
-
segments:
|
41
|
-
- 0
|
42
|
-
- 10
|
43
|
-
- 0
|
44
|
-
version: 0.10.0
|
45
37
|
type: :runtime
|
46
38
|
version_requirements: *id001
|
47
39
|
- !ruby/object:Gem::Dependency
|