turnip_formatter 0.6.0.pre.beta.3 → 0.6.0.pre.beta.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbad7611dffef3271dfb7612d409335194aca307
4
- data.tar.gz: 6a3c40e04c1bd7102d7d650f6a6c75320e6fb44b
3
+ metadata.gz: 67feb08897f64d961ba76a513c0db5b4b133c0d6
4
+ data.tar.gz: 923976e4503e4588819f9adc5b625e89505990b5
5
5
  SHA512:
6
- metadata.gz: b14e712926f1e8178f74157da2d1ac9d3f5f4f7780d3c2b98df0454665ae61ef3a823c4c743a619005b25e55040e162bfda220d385af87eef915e79f1fd64b7d
7
- data.tar.gz: 5d79301f0c1b0565145157a030728919c40ecb98325ecd9ed775f06f1f6fd8ef5e6aa3b333c8f66407cabec675f68e6495582e11ac6f0ff02c8bca74611499ad
6
+ metadata.gz: 41bc4fcec63fb4ef824d976b5f6c51f12f05d985716755fe1c1e6ee03cbab1ba7a5c00f007735c982d58b02d173f201bb2f7f2593356d508b7477995b7f3ff8f
7
+ data.tar.gz: 8a451d6cc4471516b21499385e7300c2decccc554a652fc9d614eec35323db7b1a0b70ade4b7c014b6092e231a790f4d19ed0c45196dfecae8aec5976525d0da
@@ -1,5 +1,5 @@
1
1
  <div id="<%= id %>" class="step <%= status %>">
2
- <div class="step-title"><%= keyword %> <%= text %></div>
2
+ <div class="step-title"><%= ERB::Util.h(keyword) %> <%= ERB::Util.h(text) %></div>
3
3
 
4
4
  <% if has_appendix? %>
5
5
  <div class="step-body">
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module TurnipFormatter
4
- VERSION = '0.6.0-beta.3'
4
+ VERSION = '0.6.0-beta.4'
5
5
  end
@@ -35,6 +35,21 @@ module TurnipFormatter::Renderer::Html
35
35
  end
36
36
  end
37
37
 
38
+ sub_test_case 'step should be escaped html style' do
39
+ def setup
40
+ resource = TurnipFormatter::Resource::Step.new(nil, sample_step_should_escaping)
41
+ @renderer = Step.new(resource)
42
+ end
43
+
44
+ def test_render
45
+ rendered = @renderer.render
46
+ document = html_parse(@renderer.render).at_xpath('/div')
47
+
48
+ assert_not_nil(%r{<div class="step-title">When step &gt;should&lt; escaped</div>}.match(rendered))
49
+ assert_nil(document.at_css('div.step-body'))
50
+ end
51
+ end
52
+
38
53
  private
39
54
 
40
55
  def sample_step
@@ -45,6 +60,10 @@ module TurnipFormatter::Renderer::Html
45
60
  sample_feature.scenarios[0].steps[1]
46
61
  end
47
62
 
63
+ def sample_step_should_escaping
64
+ sample_feature.scenarios[0].steps[2]
65
+ end
66
+
48
67
  def sample_feature
49
68
  feature_build(feature_text)
50
69
  end
@@ -59,6 +78,7 @@ module TurnipFormatter::Renderer::Html
59
78
  """
60
79
  DocString
61
80
  """
81
+ When step >should< escaped
62
82
  EOS
63
83
  end
64
84
  end
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.6.0.pre.beta.3
4
+ version: 0.6.0.pre.beta.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: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: turnip