turnip_formatter 0.6.0.pre.beta.2 → 0.6.0.pre.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/Rakefile +3 -2
- data/lib/rspec/core/formatters/turnip_formatter.rb +8 -9
- data/lib/turnip_formatter/ext/turnip/rspec.rb +6 -5
- data/lib/turnip_formatter/{template → renderer/html/assets}/turnip_formatter.css +1 -1
- data/lib/turnip_formatter/{template → renderer/html/assets}/turnip_formatter.js +0 -0
- data/lib/turnip_formatter/{template → renderer/html/assets}/turnip_formatter.scss +1 -1
- data/lib/turnip_formatter/renderer/html/base.rb +4 -4
- data/lib/turnip_formatter/renderer/html/index.rb +83 -0
- data/lib/turnip_formatter/renderer/html/runtime_error.rb +20 -0
- data/lib/turnip_formatter/renderer/html/scenario.rb +20 -0
- data/lib/turnip_formatter/renderer/html/statistics_feature.rb +45 -0
- data/lib/turnip_formatter/renderer/html/statistics_speed.rb +39 -0
- data/lib/turnip_formatter/renderer/html/statistics_tag.rb +53 -0
- data/lib/turnip_formatter/renderer/html/views/index.html.erb +94 -0
- data/lib/turnip_formatter/renderer/html/views/runtime_error.html.erb +20 -0
- data/lib/turnip_formatter/renderer/html/views/scenario.html.erb +23 -0
- data/lib/turnip_formatter/renderer/html/views/statistics_feature.html.erb +24 -0
- data/lib/turnip_formatter/renderer/html/views/statistics_speed.html.erb +24 -0
- data/lib/turnip_formatter/renderer/html/views/statistics_tag.html.erb +24 -0
- data/lib/turnip_formatter/renderer/html.rb +84 -0
- data/lib/turnip_formatter/resource/scenario/base.rb +80 -0
- data/lib/turnip_formatter/resource/scenario/failure.rb +50 -0
- data/lib/turnip_formatter/resource/scenario/pass.rb +10 -0
- data/lib/turnip_formatter/resource/scenario/pending.rb +42 -0
- data/lib/turnip_formatter/version.rb +1 -1
- data/lib/turnip_formatter.rb +8 -4
- data/test/helper.rb +64 -12
- data/test/turnip_formatter/renderer/html/test_index.rb +102 -0
- data/test/turnip_formatter/renderer/html/test_runtime_error.rb +40 -0
- data/test/turnip_formatter/renderer/html/test_statistics_feature.rb +102 -0
- data/test/turnip_formatter/renderer/html/test_statistics_speed.rb +77 -0
- data/test/turnip_formatter/renderer/html/test_statistics_tag.rb +112 -0
- data/test/turnip_formatter/renderer/html/test_step.rb +27 -0
- data/test/turnip_formatter/renderer/test_html.rb +75 -0
- data/test/turnip_formatter/resource/scenario/test_failure.rb +39 -0
- data/test/turnip_formatter/resource/scenario/test_pass.rb +65 -0
- data/test/turnip_formatter/resource/scenario/test_pending.rb +39 -0
- data/turnip_formatter.gemspec +1 -1
- metadata +45 -57
- data/lib/turnip_formatter/printer/index.rb +0 -26
- data/lib/turnip_formatter/printer/runtime_error.rb +0 -36
- data/lib/turnip_formatter/printer/scenario.rb +0 -22
- data/lib/turnip_formatter/printer/tab_feature_statistics.rb +0 -46
- data/lib/turnip_formatter/printer/tab_speed_statistics.rb +0 -35
- data/lib/turnip_formatter/printer/tab_tag_statistics.rb +0 -76
- data/lib/turnip_formatter/printer.rb +0 -29
- data/lib/turnip_formatter/scenario/base.rb +0 -99
- data/lib/turnip_formatter/scenario/failure.rb +0 -44
- data/lib/turnip_formatter/scenario/pass.rb +0 -8
- data/lib/turnip_formatter/scenario/pending.rb +0 -40
- data/lib/turnip_formatter/step.rb +0 -23
- data/lib/turnip_formatter/template/exception.slim +0 -8
- data/lib/turnip_formatter/template/index.slim +0 -86
- data/lib/turnip_formatter/template/runtime_exception.slim +0 -13
- data/lib/turnip_formatter/template/scenario.slim +0 -15
- data/lib/turnip_formatter/template/tab_feature_statistics.slim +0 -18
- data/lib/turnip_formatter/template/tab_speed_statistics.slim +0 -16
- data/lib/turnip_formatter/template/tab_tag_statistics.slim +0 -18
- data/spec/turnip_formatter/printer/index_spec.rb +0 -38
- data/spec/turnip_formatter/printer/scenario_spec.rb +0 -42
- data/spec/turnip_formatter/printer/tab_feature_statistics_spec.rb +0 -80
- data/spec/turnip_formatter/printer/tab_speed_statistics_spec.rb +0 -48
- data/spec/turnip_formatter/printer/tab_tag_statistics_spec.rb +0 -103
- data/spec/turnip_formatter/scenario/base_spec.rb +0 -67
- data/spec/turnip_formatter/scenario/failure_spec.rb +0 -55
- data/spec/turnip_formatter/scenario/pending_spec.rb +0 -51
- data/spec/turnip_formatter/template_spec.rb +0 -119
- data/test/sample.feature +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbad7611dffef3271dfb7612d409335194aca307
|
4
|
+
data.tar.gz: 6a3c40e04c1bd7102d7d650f6a6c75320e6fb44b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14e712926f1e8178f74157da2d1ac9d3f5f4f7780d3c2b98df0454665ae61ef3a823c4c743a619005b25e55040e162bfda220d385af87eef915e79f1fd64b7d
|
7
|
+
data.tar.gz: 5d79301f0c1b0565145157a030728919c40ecb98325ecd9ed775f06f1f6fd8ef5e6aa3b333c8f66407cabec675f68e6495582e11ac6f0ff02c8bca74611499ad
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -5,10 +5,11 @@ require 'rake/testtask'
|
|
5
5
|
|
6
6
|
desc 'Compile report CSS file'
|
7
7
|
task :compile do
|
8
|
-
|
8
|
+
dir = 'lib/turnip_formatter/renderer/html/assets'
|
9
|
+
input = open("#{dir}/turnip_formatter.scss").read
|
9
10
|
engine = Sass::Engine.new(input, syntax: :scss, style: :compressed)
|
10
11
|
|
11
|
-
File.open(
|
12
|
+
File.open("#{dir}/turnip_formatter.css", 'w') do |f|
|
12
13
|
f.write engine.render
|
13
14
|
end
|
14
15
|
end
|
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
require 'rspec'
|
4
4
|
require 'rspec/core/formatters/base_formatter'
|
5
|
-
require 'turnip_formatter/
|
6
|
-
require 'turnip_formatter/scenario/
|
7
|
-
require 'turnip_formatter/scenario/
|
8
|
-
require 'turnip_formatter/
|
9
|
-
require 'turnip_formatter/printer/scenario'
|
5
|
+
require 'turnip_formatter/renderer/html/index'
|
6
|
+
require 'turnip_formatter/resource/scenario/pass'
|
7
|
+
require 'turnip_formatter/resource/scenario/failure'
|
8
|
+
require 'turnip_formatter/resource/scenario/pending'
|
10
9
|
|
11
10
|
module RSpec
|
12
11
|
module Core
|
@@ -37,24 +36,24 @@ module RSpec
|
|
37
36
|
end
|
38
37
|
|
39
38
|
def example_passed(notification)
|
40
|
-
scenario = ::TurnipFormatter::Scenario::Pass.new(notification.example)
|
39
|
+
scenario = ::TurnipFormatter::Resource::Scenario::Pass.new(notification.example)
|
41
40
|
scenarios << scenario
|
42
41
|
end
|
43
42
|
|
44
43
|
def example_pending(notification)
|
45
|
-
scenario = ::TurnipFormatter::Scenario::Pending.new(notification.example)
|
44
|
+
scenario = ::TurnipFormatter::Resource::Scenario::Pending.new(notification.example)
|
46
45
|
scenarios << scenario
|
47
46
|
end
|
48
47
|
|
49
48
|
def example_failed(notification)
|
50
|
-
scenario = ::TurnipFormatter::Scenario::Failure.new(notification.example)
|
49
|
+
scenario = ::TurnipFormatter::Resource::Scenario::Failure.new(notification.example)
|
51
50
|
scenarios << scenario
|
52
51
|
end
|
53
52
|
|
54
53
|
private
|
55
54
|
|
56
55
|
def output_html(params)
|
57
|
-
output.puts ::TurnipFormatter::
|
56
|
+
output.puts ::TurnipFormatter::Renderer::Html::Index.new(params).render
|
58
57
|
end
|
59
58
|
end
|
60
59
|
end
|
@@ -11,6 +11,8 @@ module Turnip
|
|
11
11
|
original_run(feature_file)
|
12
12
|
|
13
13
|
feature = Turnip::Builder.build(feature_file)
|
14
|
+
return nil if feature.nil?
|
15
|
+
|
14
16
|
example_group = ::RSpec.world.example_groups.last
|
15
17
|
|
16
18
|
update_metadata(feature, example_group)
|
@@ -21,15 +23,14 @@ module Turnip
|
|
21
23
|
# @param [RSpec::Core::ExampleGroup] example_group
|
22
24
|
#
|
23
25
|
def update_metadata(feature, example_group)
|
24
|
-
background_steps = feature.backgrounds.map(&:steps).flatten
|
25
26
|
examples = example_group.children
|
26
27
|
|
27
28
|
feature.scenarios.zip(examples).each do |scenario, parent_example|
|
28
29
|
example = parent_example.examples.first
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
example.metadata[:turnip_formatter] = {
|
31
|
+
feature: feature,
|
32
|
+
scenario: scenario,
|
33
|
+
}
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|