turnip_formatter 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/README.md +1 -3
- data/lib/turnip_formatter/template/turnip_formatter.css +1 -1
- data/lib/turnip_formatter/version.rb +1 -1
- data/spec/gemfiles/Gemfile-rspec-3.1.x +4 -0
- data/spec/gemfiles/Gemfile-rspec-3.2.x +4 -0
- data/spec/spec_helper.rb +0 -1
- data/spec/turnip_formatter/printer/index_spec.rb +4 -6
- data/spec/turnip_formatter/printer/scenario_spec.rb +4 -4
- data/spec/turnip_formatter/printer/step_extra_args_spec.rb +4 -13
- data/spec/turnip_formatter/printer/step_spec.rb +12 -21
- data/spec/turnip_formatter/printer/tab_speed_statistics_spec.rb +13 -5
- data/spec/turnip_formatter/step_template/exception_spec.rb +3 -12
- data/spec/turnip_formatter/step_template/source_spec.rb +3 -3
- data/spec/turnip_formatter/template_spec.rb +2 -2
- data/turnip_formatter.gemspec +1 -2
- metadata +8 -18
data/spec/spec_helper.rb
CHANGED
@@ -14,10 +14,10 @@ module TurnipFormatter::Printer
|
|
14
14
|
}
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
subject { Index.print_out(formatter) }
|
17
|
+
subject { Index.print_out(formatter) }
|
19
18
|
|
20
|
-
|
19
|
+
describe '.print_out' do
|
20
|
+
it { should match %r{<h1>Turnip Report</h1>} }
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'project_name is changed' do
|
@@ -27,9 +27,7 @@ module TurnipFormatter::Printer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
describe '.print_out' do
|
30
|
-
|
31
|
-
|
32
|
-
it { should have_tag 'h1', text: 'My Project Report' }
|
30
|
+
it { should match %r{<h1>My Project Report</h1>} }
|
33
31
|
end
|
34
32
|
|
35
33
|
after do
|
@@ -14,10 +14,10 @@ describe TurnipFormatter::Printer::Scenario do
|
|
14
14
|
context 'with turnip example' do
|
15
15
|
subject { described_class.print_out(scenario) }
|
16
16
|
|
17
|
-
it { should
|
18
|
-
it { should
|
19
|
-
it { should
|
20
|
-
it { should
|
17
|
+
it { should match %r{<a .*href="##{scenario.id}"} }
|
18
|
+
it { should match %r{<div class="scenario-title">.*Scenario: Scenario} }
|
19
|
+
it { should match %{<ul class="tags">} }
|
20
|
+
it { should match %{<div class="steps} }
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'with no turnip example' do
|
@@ -15,18 +15,9 @@ module TurnipFormatter::Printer
|
|
15
15
|
|
16
16
|
subject { StepExtraArgs.print_out([string]) }
|
17
17
|
|
18
|
-
it {
|
19
|
-
|
20
|
-
|
21
|
-
with_tag 'tr:nth-child(1) td:nth-child(2)', text: /Money/
|
22
|
-
|
23
|
-
with_tag 'tr:nth-child(2) td:nth-child(1)', text: /<Tokushima>/
|
24
|
-
with_tag 'tr:nth-child(2) td:nth-child(2)', text: /555/
|
25
|
-
|
26
|
-
with_tag 'tr:nth-child(3) td:nth-child(1)', text: /<Okinawa>/
|
27
|
-
with_tag 'tr:nth-child(3) td:nth-child(2)', text: /368/
|
28
|
-
end
|
29
|
-
}
|
18
|
+
it { should match %r{<td>State</td>[[:space:]]*<td>Money</td>} }
|
19
|
+
it { should match %r{<td><Tokushima></td>[[:space:]]*<td>555</td>} }
|
20
|
+
it { should match %r{<td><Okinawa></td>[[:space:]]*<td>368</td>} }
|
30
21
|
end
|
31
22
|
end
|
32
23
|
|
@@ -34,7 +25,7 @@ module TurnipFormatter::Printer
|
|
34
25
|
describe '.print_out' do
|
35
26
|
let(:string) { 'a<a>a' }
|
36
27
|
subject { StepExtraArgs.print_out([string]) }
|
37
|
-
it { should
|
28
|
+
it { should match %r{<pre class="multiline">a<a>a</pre>} }
|
38
29
|
end
|
39
30
|
end
|
40
31
|
end
|
@@ -12,11 +12,10 @@ describe TurnipFormatter::Printer::Step do
|
|
12
12
|
step
|
13
13
|
end
|
14
14
|
|
15
|
-
it
|
16
|
-
should
|
17
|
-
|
18
|
-
|
19
|
-
end
|
15
|
+
it {
|
16
|
+
should match %r{<div class="step passed">}
|
17
|
+
should match %r{<div class="step-title">}
|
18
|
+
}
|
20
19
|
end
|
21
20
|
|
22
21
|
context 'has table argument' do
|
@@ -28,14 +27,10 @@ describe TurnipFormatter::Printer::Step do
|
|
28
27
|
step
|
29
28
|
end
|
30
29
|
|
31
|
-
it
|
32
|
-
should
|
33
|
-
|
34
|
-
|
35
|
-
with_tag 'table.step_outline'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
30
|
+
it {
|
31
|
+
should match %r{<div class="step-body">}
|
32
|
+
should match %r{<table class="step_outline">}
|
33
|
+
}
|
39
34
|
end
|
40
35
|
|
41
36
|
context 'has outline argument' do
|
@@ -43,14 +38,10 @@ describe TurnipFormatter::Printer::Step do
|
|
43
38
|
passed_step
|
44
39
|
end
|
45
40
|
|
46
|
-
it
|
47
|
-
should
|
48
|
-
|
49
|
-
|
50
|
-
with_tag 'table.multiline'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
41
|
+
it {
|
42
|
+
should match %r{<div class="step-body">}
|
43
|
+
should match %r{<pre class="multiline">}
|
44
|
+
}
|
54
45
|
end
|
55
46
|
end
|
56
47
|
end
|
@@ -18,11 +18,19 @@ module TurnipFormatter::Printer
|
|
18
18
|
html = statistics.print_out(passed_scenarios)
|
19
19
|
|
20
20
|
passed_scenarios.sort { |a,b| a.run_time <=> b.run_time }.each.with_index(1) do |scenario, index|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
tag_feature_name = "<span>#{scenario.feature_name}</span>"
|
22
|
+
tag_scenario_name = "<a href=\"\##{scenario.id}\">#{scenario.name}</a>"
|
23
|
+
tag_run_time = "<span>#{scenario.run_time} sec</span>"
|
24
|
+
|
25
|
+
expect_match = [
|
26
|
+
'<tr>',
|
27
|
+
"<td>#{tag_feature_name}</td>",
|
28
|
+
"<td>#{tag_scenario_name}</td>",
|
29
|
+
"<td>#{tag_run_time}</td>",
|
30
|
+
'</tr>'
|
31
|
+
].join
|
32
|
+
|
33
|
+
expect(html).to match %r(#{expect_match})
|
26
34
|
end
|
27
35
|
end
|
28
36
|
end
|
@@ -13,22 +13,13 @@ describe TurnipFormatter::StepTemplate::Exception do
|
|
13
13
|
describe '#build_failed' do
|
14
14
|
subject { template.build_failed(failed_example) }
|
15
15
|
|
16
|
-
it
|
17
|
-
expect(subject).to have_tag 'div.step_exception' do
|
18
|
-
with_tag 'pre'
|
19
|
-
with_tag 'ol > li'
|
20
|
-
end
|
21
|
-
end
|
16
|
+
it { should match %r{<div class="step_exception">} }
|
22
17
|
end
|
23
18
|
|
24
19
|
describe '#build_pending' do
|
25
20
|
subject { template.build_pending(pending_example) }
|
26
21
|
|
27
|
-
it
|
28
|
-
|
29
|
-
with_tag 'pre', text: 'No such step(0): '
|
30
|
-
with_tag 'ol > li'
|
31
|
-
end
|
32
|
-
end
|
22
|
+
it { should match %r{<div class="step_exception">} }
|
23
|
+
it { should match %r{<pre>No such step} }
|
33
24
|
end
|
34
25
|
end
|
@@ -10,9 +10,9 @@ describe TurnipFormatter::StepTemplate::Source do
|
|
10
10
|
subject { template.build(failed_example) }
|
11
11
|
|
12
12
|
it do
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
should match %r{<pre class="source">}
|
14
|
+
should match %r{<code class="ruby">}
|
15
|
+
should match %r{<span class="linenum">}
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -65,7 +65,7 @@ describe TurnipFormatter::Template do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
context 'add incorrect uri' do
|
68
|
-
let(:path) { 'http://
|
68
|
+
let(:path) { 'http://e xample.com/foo.js' }
|
69
69
|
it { should be_empty }
|
70
70
|
end
|
71
71
|
end
|
@@ -111,7 +111,7 @@ describe TurnipFormatter::Template do
|
|
111
111
|
end
|
112
112
|
|
113
113
|
context 'add incorrect uri' do
|
114
|
-
let(:path) { 'http://
|
114
|
+
let(:path) { 'http://e xample.com/foo.css' }
|
115
115
|
it { should be_empty }
|
116
116
|
end
|
117
117
|
end
|
data/turnip_formatter.gemspec
CHANGED
@@ -18,12 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^spec/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'turnip', '~> 1.
|
21
|
+
spec.add_dependency 'turnip', '~> 1.3.0'
|
22
22
|
spec.add_dependency 'slim'
|
23
23
|
spec.add_dependency 'rspec', ['>=2.14.0', '<4.0']
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
25
|
spec.add_development_dependency 'rake'
|
26
|
-
spec.add_development_dependency 'rspec-html-matchers'
|
27
26
|
spec.add_development_dependency 'coveralls'
|
28
27
|
spec.add_development_dependency 'guard-rspec'
|
29
28
|
spec.add_development_dependency 'sass'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnip_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wataru MIYAGUNI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: turnip
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: slim
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,20 +86,6 @@ dependencies:
|
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: rspec-html-matchers
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - ">="
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
103
89
|
- !ruby/object:Gem::Dependency
|
104
90
|
name: coveralls
|
105
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,6 +217,8 @@ files:
|
|
231
217
|
- spec/gemfiles/Gemfile-rspec-2.14.x
|
232
218
|
- spec/gemfiles/Gemfile-rspec-2.99.x
|
233
219
|
- spec/gemfiles/Gemfile-rspec-3.0.x
|
220
|
+
- spec/gemfiles/Gemfile-rspec-3.1.x
|
221
|
+
- spec/gemfiles/Gemfile-rspec-3.2.x
|
234
222
|
- spec/spec_helper.rb
|
235
223
|
- spec/support/example_helper.rb
|
236
224
|
- spec/support/passed.feature
|
@@ -278,6 +266,8 @@ test_files:
|
|
278
266
|
- spec/gemfiles/Gemfile-rspec-2.14.x
|
279
267
|
- spec/gemfiles/Gemfile-rspec-2.99.x
|
280
268
|
- spec/gemfiles/Gemfile-rspec-3.0.x
|
269
|
+
- spec/gemfiles/Gemfile-rspec-3.1.x
|
270
|
+
- spec/gemfiles/Gemfile-rspec-3.2.x
|
281
271
|
- spec/spec_helper.rb
|
282
272
|
- spec/support/example_helper.rb
|
283
273
|
- spec/support/passed.feature
|