jekyll-swfobject 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZDYwOWMyNjFhMzZmZmQ2Njc5NDg5MTljMDA0ZGZjYjkzMjllZmY2NA==
5
- data.tar.gz: !binary |-
6
- MmQ2NmQ0MDA5MjIyMGNiNDIxN2MxMGY1MjY0MDM1MDVkMjczODQ0MQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZjdlNTdmYjVlMGY3NjJmNGU2NzRkZmI5MGFlYjBiMDI1YzIyNDQxOTQ0MTVl
10
- ZWNmYTAzZWU2YWU0ZWJlMGVmMjdkNzIyZmYxMDc3OWE1OWMzNWY5YWNiMjE3
11
- MzBkNGEyNDA3ZWJjYTI4ZTY4ZDgzNzE0YjYzNTIwNDMzMGE0YjI=
12
- data.tar.gz: !binary |-
13
- NDZmNzc5ZDlkOWJmOWRhN2FlMmE1ODBkOWRmZTg1OTM4YmViYzYzNjgxMjMz
14
- OGM4OWYwNTI5MDYzMzUyODI0MDEwZWIyNjI4NTg1OTAxZTMxZDk2MzUzZDIx
15
- ODlkYTYzZDc3OTQ0OTA1ZWJkNmVmMGU3YmUzMGEwYmY0MWM1MjQ=
2
+ SHA1:
3
+ metadata.gz: 0086a9c6c2d1020779f57a8ade13268b515b1f0c
4
+ data.tar.gz: cc98ea7027571e4bd928a5e9131b16035536ed57
5
+ SHA512:
6
+ metadata.gz: bd56a678e80b26f887ae34d925a5d54d43ff8a850a6d656fe3518f45950c877106a6ac76bc43639d47bd5ec35349e4d635dc53761d5e1b1aca3eb3f8fde86ea7
7
+ data.tar.gz: 2fb8ba35cec1d6f032e80b17e276440606ed1d887b7bc04a5240f90d74a69743340691db21de53feba4a1cb2766a77b2809292e3e4c6ab2b1e951b497ddf3019
data/.gitignore CHANGED
@@ -3,4 +3,6 @@
3
3
  .DS_Store
4
4
 
5
5
  *.rvmc
6
- Gemfile.lock
6
+ Gemfile.lock
7
+
8
+ pkg
data/History.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Revision history of jekyll-swfobject
2
2
 
3
+ ### 1.0.1 / 2013-10-01
4
+ * Bug fix: Blank block does not rendered with Liquid 2.5.1 ([issue #2](https://github.com/sectore/jekyll-swfobject/issues/2))
5
+ * Bug fix: Jekyll 1.1.2 compatibility ([issue #1](https://github.com/sectore/jekyll-swfobject/issues/1))
6
+
3
7
  ### 1.0.0 / 2013-07-04
4
8
  * Unit tests added
5
9
  * Ruby code improvements
data/README.md CHANGED
@@ -4,7 +4,7 @@ SWFObject Tag is a [Liquid](http://www.liquidmarkup.org/) plugin for [Jekyll](ht
4
4
 
5
5
  ## Installation
6
6
 
7
- 1 Add this line to your application's Gemfile:
7
+ 1) Add this line to your application's Gemfile:
8
8
 
9
9
  gem 'jekyll-swfobject'
10
10
 
@@ -16,8 +16,12 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install jekyll-swfobject
18
18
 
19
+ 2) Add in a plugin file within your Jekyll project's _plugins directory:
19
20
 
20
- 2. Link SWFObject in your layout template or page within `<head>` or before `{% swfobject %}` :
21
+ # _plugins/my-plugin.rb
22
+ require 'jekyll-swfobject'
23
+
24
+ 3) Link SWFObject in your layout template or page within `<head>` or before `{% swfobject %}` :
21
25
 
22
26
  `<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>`
23
27
 
@@ -25,8 +29,16 @@ Or install it yourself as:
25
29
  ## Usage
26
30
 
27
31
  ### Tag
28
- {% swfobject swf_url %}{% endswfobject %}
32
+ {% swfobject swf_url %}Flash Player required.{% endswfobject %}
29
33
  Note: Because SWFObject Tag is a `Liquid::Block`, you have to close any `{% swfobject %}` with `{% endswfobject %}` in your templates.
34
+ Also an alternative content within the tags is needed.
35
+
36
+ #### Alternative HTML content (required)
37
+
38
+ {% swfobject swf_url %}
39
+ <p>Latest <a href='http://www.adobe.com/go/getflashplayer'>Flash Player Plugin</a> is required.</p>
40
+ {% endswfobject %}
41
+
30
42
 
31
43
  #### Optional parameters
32
44
 
@@ -39,22 +51,15 @@ Note: Don't use whitespaces between `:` to avoid issues rendering templates.
39
51
  For all optional parameters check section [Parameters](#parameters) below.
40
52
 
41
53
 
42
- #### Alternative HTML content
43
-
44
- {% swfobject swf_url %}
45
- <p>Latest <a href='http://www.adobe.com/go/getflashplayer'>Flash Player Plugin</a> is required.</p>
46
- {% endswfobject %}
47
54
 
48
55
  #### Optional parameters defined in `_config.yml`
49
56
 
50
-
51
57
  swfobject:
52
58
  height: 350
53
59
  width: 200
54
60
  express_install_url: expressInstall.swf
55
- alternative_content: <p>Please install latest <a href='http://www.adobe.com/go/getflashplayer'>Flash Player Plugin</a>.</p>
56
61
 
57
- For all optional parameters check section [Parameters](#parameters) below.
62
+ You can define any optional paramter in `_config.yml`. For an overiew of all optional parameters check section [Parameters](#parameters) below.
58
63
 
59
64
 
60
65
  ## Parameters
@@ -20,10 +20,10 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "jekyll", "~> 1.0.3"
24
- spec.add_development_dependency("bundler", "~> 1.3")
23
+ spec.add_runtime_dependency("jekyll", ">= 1.2.1")
24
+ spec.add_development_dependency("bundler", ">= 1.3")
25
25
  spec.add_development_dependency("rake")
26
26
  spec.add_development_dependency("shoulda", "~> 3.5")
27
- spec.add_development_dependency("shoulda-context", "~> 1.0")
28
- spec.add_development_dependency("mocha", ">= 0.14")
27
+ spec.add_development_dependency("shoulda-context", "~> 1.1.5")
28
+ spec.add_development_dependency("mocha", "~> 0.14.0")
29
29
  end
@@ -35,19 +35,18 @@ module Jekyll
35
35
  )
36
36
 
37
37
  @@DEFAULTS = {
38
- :content_id => 'flashcontent',
39
- :width => '100%',
40
- :height => '100%',
41
- :version => '10.0',
42
- :flashvars => '',
43
- :alternative_content => "<p>Please install latest <a href='http://www.adobe.com/go/getflashplayer'>Flash Player Plugin</a>.</p>"
38
+ :content_id => 'flashcontent',
39
+ :width => '100%',
40
+ :height => '100%',
41
+ :version => '10.0',
42
+ :flashvars => ''
44
43
  }
45
44
 
46
45
  def self.DEFAULTS
47
46
  return @@DEFAULTS
48
47
  end
49
48
 
50
- def initialize(tag_name, text, tokens)
49
+ def initialize(tag_name, markup, tokens)
51
50
  super
52
51
 
53
52
  @config = {}
@@ -60,7 +59,7 @@ module Jekyll
60
59
  override_config(config)
61
60
  end
62
61
 
63
- params = text.split
62
+ params = markup.split
64
63
 
65
64
  # first argument (required) is url of swf
66
65
  @swf_url = params.shift.strip
@@ -83,17 +82,22 @@ module Jekyll
83
82
  end
84
83
 
85
84
  def render(context)
86
- output = super
85
+ content = super
86
+
87
+ # raise an error if the swfobject block has no content
88
+ if content.strip.size <= 0
89
+ raise ScriptError.new("swfobject tag can not be empty")
90
+ end
87
91
 
88
92
  <<-HTML.gsub /^\s+/, '' # remove whitespaces from heredocs
89
93
  <div id="#{@config[:content_id]}-wrapper" style="width: #{@config[:width]}; height: #{@config[:height]}">
90
- <div id="#{@config[:content_id]}" style="width: 100%; height:100%">#{render_alternative_content(output)}</div>
94
+ <div id="#{@config[:content_id]}" style="width: 100%; height:100%">#{content}</div>
91
95
  </div>
92
96
  <script type="text/javascript">
93
97
  // <![CDATA[
94
98
  #{render_flashvars()}
95
- #{render_params()}
96
- #{render_attributes()}
99
+ #{render_params()}
100
+ #{render_attributes()}
97
101
  swfobject.embedSWF(
98
102
  '#{@swf_url}',
99
103
  '#{@config[:content_id]}',
@@ -111,13 +115,6 @@ module Jekyll
111
115
  HTML
112
116
  end
113
117
 
114
- def render_alternative_content(output)
115
- unless output.strip.size > 0
116
- output = @config[:alternative_content]
117
- end
118
- output
119
- end
120
-
121
118
  def render_params
122
119
  result = 'var params = {'
123
120
  @config.each do |key, value|
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module SWFObject
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require 'test/unit'
2
2
  require 'test/unit/assertions'
3
3
  require 'jekyll'
4
+ require 'liquid.rb'
4
5
  require_relative '../lib/jekyll-swfobject'
5
6
 
6
7
  # Test assertion helper to check template result
@@ -26,7 +27,7 @@ module MockData
26
27
  :content_id => Jekyll::SWFObject::SWFObjectTag.DEFAULTS[:content_id],
27
28
  :width => Jekyll::SWFObject::SWFObjectTag.DEFAULTS[:width],
28
29
  :height => Jekyll::SWFObject::SWFObjectTag.DEFAULTS[:height],
29
- :alternative_content => Jekyll::SWFObject::SWFObjectTag.DEFAULTS[:alternative_content],
30
+ :alternative_content => "Flash Player required.",
30
31
  :flashvars => 'var flashvars = {};',
31
32
  :params => 'var params = {};',
32
33
  :attributes => 'var attributes = {};',
@@ -16,35 +16,35 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
16
16
  context 'template with attributes' do
17
17
  should 'uses default values' do
18
18
  expected = expected_output_by_test_data()
19
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
19
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
20
20
  assert_template_result expected, template
21
21
  end
22
22
 
23
23
  should 'render a custom swf url' do
24
24
  swf_url = 'another/path/to.swf'
25
25
  expected = expected_output_by_test_data({:swf_url => swf_url})
26
- template = "{% swfobject #{swf_url} %}{% endswfobject %}"
26
+ template = "{% swfobject #{swf_url} %}#{@test_data[:alternative_content]}{% endswfobject %}"
27
27
  assert_template_result expected, template
28
28
  end
29
29
 
30
30
  should 'render a custom content_id' do
31
31
  content_id = 'halli-galli-id'
32
32
  expected = expected_output_by_test_data({:content_id => content_id})
33
- template = "{% swfobject #{@test_data[:swf_url]} content_id:#{content_id} %}{% endswfobject %}"
33
+ template = "{% swfobject #{@test_data[:swf_url]} content_id:#{content_id} %}#{@test_data[:alternative_content]}{% endswfobject %}"
34
34
  assert_template_result expected, template
35
35
  end
36
36
 
37
37
  should 'render a custom width' do
38
38
  width = '23px'
39
39
  expected = expected_output_by_test_data({:width => width})
40
- template = "{% swfobject #{@test_data[:swf_url]} width:#{width} %}{% endswfobject %}"
40
+ template = "{% swfobject #{@test_data[:swf_url]} width:#{width} %}#{@test_data[:alternative_content]}{% endswfobject %}"
41
41
  assert_template_result expected, template
42
42
  end
43
43
 
44
44
  should 'render a custom height' do
45
45
  height = '44px'
46
46
  expected = expected_output_by_test_data({:height => height})
47
- template = "{% swfobject #{@test_data[:swf_url]} height:#{height} %}{% endswfobject %}"
47
+ template = "{% swfobject #{@test_data[:swf_url]} height:#{height} %}#{@test_data[:alternative_content]}{% endswfobject %}"
48
48
  assert_template_result expected, template
49
49
  end
50
50
 
@@ -58,7 +58,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
58
58
  should 'render a custom flash version' do
59
59
  version = '11.4'
60
60
  expected = expected_output_by_test_data({:version => version})
61
- template = "{% swfobject #{@test_data[:swf_url]} version:#{version}%}{% endswfobject %}"
61
+ template = "{% swfobject #{@test_data[:swf_url]} version:#{version}%}#{@test_data[:alternative_content]}{% endswfobject %}"
62
62
  assert_template_result expected, template
63
63
  end
64
64
 
@@ -67,7 +67,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
67
67
  valueA = 'valueA'
68
68
  flashVars = "var flashvars = {#{varA}:'#{valueA}'};"
69
69
  expected = expected_output_by_test_data({:flashvars => flashVars})
70
- template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}%}{% endswfobject %}"
70
+ template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}%}#{@test_data[:alternative_content]}{% endswfobject %}"
71
71
  assert_template_result expected, template
72
72
  end
73
73
 
@@ -78,7 +78,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
78
78
  valueB = 'valueB'
79
79
  flashVars = "var flashvars = {#{varA}:'#{valueA}',#{varB}:'#{valueB}'};"
80
80
  expected = expected_output_by_test_data({:flashvars => flashVars})
81
- template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}&#{varB}=#{valueB}%}{% endswfobject %}"
81
+ template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}&#{varB}=#{valueB}%}#{@test_data[:alternative_content]}{% endswfobject %}"
82
82
  assert_template_result expected, template
83
83
  end
84
84
 
@@ -87,7 +87,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
87
87
  value = 'any-id'
88
88
  attributes = "var attributes = {#{attribute}:'#{value}'};"
89
89
  expected = expected_output_by_test_data({:attributes => attributes})
90
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
90
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
91
91
  assert_template_result expected, template
92
92
  end
93
93
 
@@ -96,7 +96,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
96
96
  value = 'l'
97
97
  attributes = "var attributes = {#{attribute}:'#{value}'};"
98
98
  expected = expected_output_by_test_data({:attributes => attributes})
99
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
99
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
100
100
  assert_template_result expected, template
101
101
  end
102
102
 
@@ -105,7 +105,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
105
105
  value = 'any-name'
106
106
  attributes = "var attributes = {#{attribute}:'#{value}'};"
107
107
  expected = expected_output_by_test_data({:attributes => attributes})
108
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
108
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
109
109
  assert_template_result expected, template
110
110
  end
111
111
 
@@ -114,7 +114,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
114
114
  value = 'any-class'
115
115
  attributes = "var attributes = {#{attribute}:'#{value}'};"
116
116
  expected = expected_output_by_test_data({:attributes => attributes})
117
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
117
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
118
118
  assert_template_result expected, template
119
119
  end
120
120
 
@@ -125,7 +125,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
125
125
  value_align = 'center'
126
126
  attributes = "var attributes = {#{attribute_id}:'#{value_id}',#{attribute_align}:'#{value_align}'};"
127
127
  expected = expected_output_by_test_data({:attributes => attributes})
128
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute_id}:#{value_id} #{attribute_align}:#{value_align} %}{% endswfobject %}"
128
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute_id}:#{value_id} #{attribute_align}:#{value_align} %}#{@test_data[:alternative_content]}{% endswfobject %}"
129
129
  assert_template_result expected, template
130
130
  end
131
131
 
@@ -134,7 +134,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
134
134
  value = 'true'
135
135
  rendered_params = "var params = {#{param}:'#{value}'};"
136
136
  expected = expected_output_by_test_data({:params => rendered_params})
137
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
137
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
138
138
  assert_template_result expected, template
139
139
  end
140
140
 
@@ -143,7 +143,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
143
143
  value = 'false'
144
144
  rendered_params = "var params = {#{param}:'#{value}'};"
145
145
  expected = expected_output_by_test_data({:params => rendered_params})
146
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
146
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
147
147
  assert_template_result expected, template
148
148
  end
149
149
 
@@ -152,7 +152,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
152
152
  value = 'false'
153
153
  rendered_params = "var params = {#{param}:'#{value}'};"
154
154
  expected = expected_output_by_test_data({:params => rendered_params})
155
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
155
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
156
156
  assert_template_result expected, template
157
157
  end
158
158
 
@@ -161,7 +161,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
161
161
  value = 'best'
162
162
  rendered_params = "var params = {#{param}:'#{value}'};"
163
163
  expected = expected_output_by_test_data({:params => rendered_params})
164
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
164
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
165
165
  assert_template_result expected, template
166
166
  end
167
167
 
@@ -170,7 +170,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
170
170
  value = 'exactfit'
171
171
  rendered_params = "var params = {#{param}:'#{value}'};"
172
172
  expected = expected_output_by_test_data({:params => rendered_params})
173
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
173
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
174
174
  assert_template_result expected, template
175
175
  end
176
176
 
@@ -179,7 +179,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
179
179
  value = 'tr'
180
180
  rendered_params = "var params = {#{param}:'#{value}'};"
181
181
  expected = expected_output_by_test_data({:params => rendered_params})
182
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
182
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
183
183
  assert_template_result expected, template
184
184
  end
185
185
 
@@ -188,7 +188,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
188
188
  value = 'window'
189
189
  rendered_params = "var params = {#{param}:'#{value}'};"
190
190
  expected = expected_output_by_test_data({:params => rendered_params})
191
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
191
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
192
192
  assert_template_result expected, template
193
193
  end
194
194
 
@@ -197,7 +197,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
197
197
  value = '#FFF'
198
198
  rendered_params = "var params = {#{param}:'#{value}'};"
199
199
  expected = expected_output_by_test_data({:params => rendered_params})
200
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
200
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
201
201
  assert_template_result expected, template
202
202
  end
203
203
 
@@ -206,7 +206,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
206
206
  value = 'http://any-base-url.com'
207
207
  rendered_params = "var params = {#{param}:'#{value}'};"
208
208
  expected = expected_output_by_test_data({:params => rendered_params})
209
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
209
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
210
210
  assert_template_result expected, template
211
211
  end
212
212
 
@@ -215,7 +215,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
215
215
  value = 'true'
216
216
  rendered_params = "var params = {#{param}:'#{value}'};"
217
217
  expected = expected_output_by_test_data({:params => rendered_params})
218
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
218
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
219
219
  assert_template_result expected, template
220
220
  end
221
221
 
@@ -224,7 +224,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
224
224
  value = 'false'
225
225
  rendered_params = "var params = {#{param}:'#{value}'};"
226
226
  expected = expected_output_by_test_data({:params => rendered_params})
227
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
227
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
228
228
  assert_template_result expected, template
229
229
  end
230
230
 
@@ -233,7 +233,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
233
233
  value = 'sameDomain'
234
234
  rendered_params = "var params = {#{param}:'#{value}'};"
235
235
  expected = expected_output_by_test_data({:params => rendered_params})
236
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
236
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
237
237
  assert_template_result expected, template
238
238
  end
239
239
 
@@ -242,7 +242,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
242
242
  value = 'false'
243
243
  rendered_params = "var params = {#{param}:'#{value}'};"
244
244
  expected = expected_output_by_test_data({:params => rendered_params})
245
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
245
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
246
246
  assert_template_result expected, template
247
247
  end
248
248
 
@@ -251,7 +251,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
251
251
  value = 'true'
252
252
  rendered_params = "var params = {#{param}:'#{value}'};"
253
253
  expected = expected_output_by_test_data({:params => rendered_params})
254
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
254
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
255
255
  assert_template_result expected, template
256
256
  end
257
257
 
@@ -260,7 +260,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
260
260
  value = 'none'
261
261
  rendered_params = "var params = {#{param}:'#{value}'};"
262
262
  expected = expected_output_by_test_data({:params => rendered_params})
263
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
263
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
264
264
  assert_template_result expected, template
265
265
  end
266
266
 
@@ -271,7 +271,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
271
271
  valueB = 'false'
272
272
  rendered_params = "var params = {#{attributeA}:'#{valueA}',#{attributeB}:'#{valueB}'};"
273
273
  expected = expected_output_by_test_data({:params => rendered_params})
274
- template = "{% swfobject #{@test_data[:swf_url]} #{attributeA}:#{valueA} #{attributeB}:#{valueB} %}{% endswfobject %}"
274
+ template = "{% swfobject #{@test_data[:swf_url]} #{attributeA}:#{valueA} #{attributeB}:#{valueB} %}#{@test_data[:alternative_content]}{% endswfobject %}"
275
275
  assert_template_result expected, template
276
276
  end
277
277
 
@@ -283,7 +283,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
283
283
  context 'template with attributes defined in Jekylls configuration (_config.yml)' do
284
284
  should 'uses default values' do
285
285
  expected = expected_output_by_test_data()
286
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
286
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
287
287
  assert_template_result expected, template
288
288
  end
289
289
 
@@ -294,7 +294,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
294
294
  }
295
295
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
296
296
  expected = expected_output_by_test_data(@custom_config)
297
- template = "{% swfobject #{swf_url} %}{% endswfobject %}"
297
+ template = "{% swfobject #{swf_url} %}#{@test_data[:alternative_content]}{% endswfobject %}"
298
298
  assert_template_result expected, template
299
299
  end
300
300
 
@@ -305,7 +305,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
305
305
  }
306
306
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
307
307
  expected = expected_output_by_test_data(@custom_config)
308
- template = "{% swfobject #{@test_data[:swf_url]} content_id:#{content_id} %}{% endswfobject %}"
308
+ template = "{% swfobject #{@test_data[:swf_url]} content_id:#{content_id} %}#{@test_data[:alternative_content]}{% endswfobject %}"
309
309
  assert_template_result expected, template
310
310
  end
311
311
 
@@ -316,7 +316,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
316
316
  }
317
317
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
318
318
  expected = expected_output_by_test_data(@custom_config)
319
- template = "{% swfobject #{@test_data[:swf_url]} width:#{width} %}{% endswfobject %}"
319
+ template = "{% swfobject #{@test_data[:swf_url]} width:#{width} %}#{@test_data[:alternative_content]}{% endswfobject %}"
320
320
  assert_template_result expected, template
321
321
  end
322
322
 
@@ -327,7 +327,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
327
327
  }
328
328
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
329
329
  expected = expected_output_by_test_data(@custom_config)
330
- template = "{% swfobject #{@test_data[:swf_url]} height:#{height} %}{% endswfobject %}"
330
+ template = "{% swfobject #{@test_data[:swf_url]} height:#{height} %}#{@test_data[:alternative_content]}{% endswfobject %}"
331
331
  assert_template_result expected, template
332
332
  end
333
333
 
@@ -338,7 +338,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
338
338
  }
339
339
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
340
340
  expected = expected_output_by_test_data(@custom_config)
341
- template = "{% swfobject #{@test_data[:swf_url]} %}#{alternative_content}{% endswfobject %}"
341
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
342
342
  assert_template_result expected, template
343
343
  end
344
344
 
@@ -349,7 +349,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
349
349
  }
350
350
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
351
351
  expected = expected_output_by_test_data(@custom_config)
352
- template = "{% swfobject #{@test_data[:swf_url]} version:#{version}%}{% endswfobject %}"
352
+ template = "{% swfobject #{@test_data[:swf_url]} version:#{version}%}#{@test_data[:alternative_content]}{% endswfobject %}"
353
353
  assert_template_result expected, template
354
354
  end
355
355
 
@@ -362,7 +362,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
362
362
  }
363
363
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
364
364
  expected = expected_output_by_test_data(@custom_config)
365
- template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}%}{% endswfobject %}"
365
+ template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}%}#{@test_data[:alternative_content]}{% endswfobject %}"
366
366
  assert_template_result expected, template
367
367
  end
368
368
 
@@ -377,7 +377,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
377
377
  }
378
378
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
379
379
  expected = expected_output_by_test_data(@custom_config)
380
- template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}&#{varB}=#{valueB}%}{% endswfobject %}"
380
+ template = "{% swfobject #{@test_data[:swf_url]} flashvars:#{varA}=#{valueA}&#{varB}=#{valueB}%}#{@test_data[:alternative_content]}{% endswfobject %}"
381
381
  assert_template_result expected, template
382
382
  end
383
383
 
@@ -390,7 +390,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
390
390
  }
391
391
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
392
392
  expected = expected_output_by_test_data(@custom_config)
393
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
393
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
394
394
  assert_template_result expected, template
395
395
  end
396
396
 
@@ -403,7 +403,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
403
403
  }
404
404
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
405
405
  expected = expected_output_by_test_data(@custom_config)
406
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
406
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
407
407
  assert_template_result expected, template
408
408
  end
409
409
 
@@ -416,7 +416,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
416
416
  }
417
417
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
418
418
  expected = expected_output_by_test_data(@custom_config)
419
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
419
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
420
420
  assert_template_result expected, template
421
421
  end
422
422
 
@@ -429,7 +429,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
429
429
  }
430
430
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
431
431
  expected = expected_output_by_test_data(@custom_config)
432
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
432
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
433
433
  assert_template_result expected, template
434
434
  end
435
435
 
@@ -444,7 +444,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
444
444
  }
445
445
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
446
446
  expected = expected_output_by_test_data(@custom_config)
447
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute_id}:#{value_id} #{attribute_align}:#{value_align} %}{% endswfobject %}"
447
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute_id}:#{value_id} #{attribute_align}:#{value_align} %}#{@test_data[:alternative_content]}{% endswfobject %}"
448
448
  assert_template_result expected, template
449
449
  end
450
450
 
@@ -457,7 +457,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
457
457
  }
458
458
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
459
459
  expected = expected_output_by_test_data(@custom_config)
460
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
460
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
461
461
  assert_template_result expected, template
462
462
  end
463
463
 
@@ -470,7 +470,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
470
470
  }
471
471
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
472
472
  expected = expected_output_by_test_data(@custom_config)
473
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
473
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
474
474
  assert_template_result expected, template
475
475
  end
476
476
 
@@ -483,7 +483,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
483
483
  }
484
484
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
485
485
  expected = expected_output_by_test_data(@custom_config)
486
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
486
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
487
487
  assert_template_result expected, template
488
488
  end
489
489
 
@@ -496,7 +496,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
496
496
  }
497
497
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
498
498
  expected = expected_output_by_test_data(@custom_config)
499
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
499
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
500
500
  assert_template_result expected, template
501
501
  end
502
502
 
@@ -509,7 +509,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
509
509
  }
510
510
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
511
511
  expected = expected_output_by_test_data(@custom_config)
512
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
512
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
513
513
  assert_template_result expected, template
514
514
  end
515
515
 
@@ -522,7 +522,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
522
522
  }
523
523
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
524
524
  expected = expected_output_by_test_data(@custom_config)
525
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
525
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
526
526
  assert_template_result expected, template
527
527
  end
528
528
 
@@ -535,7 +535,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
535
535
  }
536
536
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
537
537
  expected = expected_output_by_test_data(@custom_config)
538
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
538
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
539
539
  assert_template_result expected, template
540
540
  end
541
541
 
@@ -548,7 +548,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
548
548
  }
549
549
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
550
550
  expected = expected_output_by_test_data(@custom_config)
551
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
551
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
552
552
  assert_template_result expected, template
553
553
  end
554
554
 
@@ -561,7 +561,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
561
561
  }
562
562
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
563
563
  expected = expected_output_by_test_data(@custom_config)
564
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
564
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
565
565
  assert_template_result expected, template
566
566
  end
567
567
 
@@ -574,7 +574,7 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
574
574
  }
575
575
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
576
576
  expected = expected_output_by_test_data(@custom_config)
577
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
577
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
578
578
  assert_template_result expected, template
579
579
  end
580
580
 
@@ -587,14 +587,14 @@ class TestSWFObjectTagAttributes < Test::Unit::TestCase
587
587
  }
588
588
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
589
589
  expected = expected_output_by_test_data(@custom_config)
590
- template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}{% endswfobject %}"
590
+ template = "{% swfobject #{@test_data[:swf_url]} #{param}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
591
591
  assert_template_result expected, template
592
592
  end
593
593
 
594
594
  should 'NOT render a value, which are not supported' do
595
595
  attribute = 'halligalli'
596
596
  value = 'true'
597
- template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}{% endswfobject %}"
597
+ template = "{% swfobject #{@test_data[:swf_url]} #{attribute}:#{value} %}#{@test_data[:alternative_content]}{% endswfobject %}"
598
598
  rendered = Template.parse(template).render({})
599
599
  assert(!rendered.include?(attribute))
600
600
  end
@@ -21,7 +21,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
21
21
  context 'template with attributes defined in Jekylls configuration (_config.yml)' do
22
22
  should 'uses default values' do
23
23
  expected = expected_output_by_test_data()
24
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
24
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
25
25
  assert_template_result expected, template
26
26
  end
27
27
 
@@ -32,7 +32,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
32
32
  }
33
33
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
34
34
  expected = expected_output_by_test_data(@custom_config)
35
- template = "{% swfobject #{swf_url} %}{% endswfobject %}"
35
+ template = "{% swfobject #{swf_url} %}#{@test_data[:alternative_content]}{% endswfobject %}"
36
36
  assert_template_result expected, template
37
37
  end
38
38
 
@@ -42,7 +42,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
42
42
  }
43
43
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
44
44
  expected = expected_output_by_test_data(@custom_config)
45
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
45
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
46
46
  assert_template_result expected, template
47
47
  end
48
48
 
@@ -52,7 +52,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
52
52
  }
53
53
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
54
54
  expected = expected_output_by_test_data(@custom_config)
55
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
55
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
56
56
  assert_template_result expected, template
57
57
  end
58
58
 
@@ -62,7 +62,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
62
62
  }
63
63
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
64
64
  expected = expected_output_by_test_data(@custom_config)
65
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
65
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
66
66
  assert_template_result expected, template
67
67
  end
68
68
 
@@ -72,7 +72,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
72
72
  }
73
73
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
74
74
  expected = expected_output_by_test_data(@custom_config)
75
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
75
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
76
76
  assert_template_result expected, template
77
77
  end
78
78
 
@@ -82,7 +82,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
82
82
  }
83
83
  Jekyll.stubs(:configuration).returns({'swfobject' => @custom_config})
84
84
  expected = expected_output_by_test_data(@custom_config)
85
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
85
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
86
86
  assert_template_result expected, template
87
87
  end
88
88
 
@@ -99,7 +99,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
99
99
  :flashvars => "#{varA}=#{valueA}"
100
100
  }
101
101
  })
102
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
102
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
103
103
  assert_template_result expected, template
104
104
  end
105
105
 
@@ -118,7 +118,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
118
118
  :flashvars => "#{varA}=#{valueA}&#{varB}=#{valueB}"
119
119
  }
120
120
  })
121
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
121
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
122
122
  assert_template_result expected, template
123
123
  end
124
124
 
@@ -135,7 +135,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
135
135
  }
136
136
  })
137
137
  expected = expected_output_by_test_data(@custom_config)
138
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
138
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
139
139
  assert_template_result expected, template
140
140
  end
141
141
 
@@ -152,7 +152,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
152
152
  }
153
153
  })
154
154
  expected = expected_output_by_test_data(@custom_config)
155
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
155
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
156
156
  assert_template_result expected, template
157
157
  end
158
158
 
@@ -169,7 +169,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
169
169
  }
170
170
  })
171
171
  expected = expected_output_by_test_data(@custom_config)
172
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
172
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
173
173
  assert_template_result expected, template
174
174
  end
175
175
 
@@ -186,7 +186,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
186
186
  }
187
187
  })
188
188
  expected = expected_output_by_test_data(@custom_config)
189
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
189
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
190
190
  assert_template_result expected, template
191
191
  end
192
192
 
@@ -206,7 +206,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
206
206
  }
207
207
  })
208
208
  expected = expected_output_by_test_data(@custom_config)
209
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
209
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
210
210
  assert_template_result expected, template
211
211
  end
212
212
 
@@ -223,7 +223,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
223
223
  }
224
224
  })
225
225
  expected = expected_output_by_test_data(@custom_config)
226
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
226
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
227
227
  assert_template_result expected, template
228
228
  end
229
229
 
@@ -240,7 +240,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
240
240
  }
241
241
  })
242
242
  expected = expected_output_by_test_data(@custom_config)
243
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
243
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
244
244
  assert_template_result expected, template
245
245
  end
246
246
 
@@ -257,7 +257,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
257
257
  }
258
258
  })
259
259
  expected = expected_output_by_test_data(@custom_config)
260
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
260
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
261
261
  assert_template_result expected, template
262
262
  end
263
263
 
@@ -274,7 +274,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
274
274
  }
275
275
  })
276
276
  expected = expected_output_by_test_data(@custom_config)
277
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
277
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
278
278
  assert_template_result expected, template
279
279
  end
280
280
 
@@ -291,7 +291,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
291
291
  }
292
292
  })
293
293
  expected = expected_output_by_test_data(@custom_config)
294
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
294
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
295
295
  assert_template_result expected, template
296
296
  end
297
297
 
@@ -308,7 +308,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
308
308
  }
309
309
  })
310
310
  expected = expected_output_by_test_data(@custom_config)
311
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
311
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
312
312
  assert_template_result expected, template
313
313
  end
314
314
 
@@ -325,7 +325,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
325
325
  }
326
326
  })
327
327
  expected = expected_output_by_test_data(@custom_config)
328
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
328
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
329
329
  assert_template_result expected, template
330
330
  end
331
331
 
@@ -342,7 +342,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
342
342
  }
343
343
  })
344
344
  expected = expected_output_by_test_data(@custom_config)
345
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
345
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
346
346
  assert_template_result expected, template
347
347
  end
348
348
 
@@ -359,7 +359,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
359
359
  }
360
360
  })
361
361
  expected = expected_output_by_test_data(@custom_config)
362
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
362
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
363
363
  assert_template_result expected, template
364
364
  end
365
365
 
@@ -376,7 +376,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
376
376
  }
377
377
  })
378
378
  expected = expected_output_by_test_data(@custom_config)
379
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
379
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
380
380
  assert_template_result expected, template
381
381
  end
382
382
 
@@ -393,7 +393,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
393
393
  }
394
394
  })
395
395
  expected = expected_output_by_test_data(@custom_config)
396
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
396
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
397
397
  assert_template_result expected, template
398
398
  end
399
399
 
@@ -410,7 +410,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
410
410
  }
411
411
  })
412
412
  expected = expected_output_by_test_data(@custom_config)
413
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
413
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
414
414
  assert_template_result expected, template
415
415
  end
416
416
 
@@ -427,7 +427,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
427
427
  }
428
428
  })
429
429
  expected = expected_output_by_test_data(@custom_config)
430
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
430
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
431
431
  assert_template_result expected, template
432
432
  end
433
433
 
@@ -444,7 +444,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
444
444
  }
445
445
  })
446
446
  expected = expected_output_by_test_data(@custom_config)
447
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
447
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
448
448
  assert_template_result expected, template
449
449
  end
450
450
 
@@ -461,7 +461,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
461
461
  }
462
462
  })
463
463
  expected = expected_output_by_test_data(@custom_config)
464
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
464
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
465
465
  assert_template_result expected, template
466
466
  end
467
467
 
@@ -481,7 +481,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
481
481
  }
482
482
  })
483
483
  expected = expected_output_by_test_data(@custom_config)
484
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
484
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
485
485
  assert_template_result expected, template
486
486
  end
487
487
 
@@ -493,7 +493,7 @@ class TestSWFObjectTagConfig < Test::Unit::TestCase
493
493
  "#{attribute.to_sym}" => "#{value}"
494
494
  }
495
495
  })
496
- template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
496
+ template = "{% swfobject #{@test_data[:swf_url]} %}#{@test_data[:alternative_content]}{% endswfobject %}"
497
497
  rendered = Template.parse(template).render({})
498
498
  assert(!rendered.include?(attribute))
499
499
  end
@@ -0,0 +1,28 @@
1
+ require 'test/unit'
2
+ require 'shoulda'
3
+ require_relative './test_helper'
4
+
5
+ class TestSWFObjectTagContent < Test::Unit::TestCase
6
+
7
+ include MockData
8
+ include Liquid
9
+
10
+ def setup
11
+ @test_data = getDefaultData().clone
12
+ end
13
+
14
+ # tests of attributes defined in template
15
+ # ---------------------------------------------
16
+
17
+ context 'content of template' do
18
+ should 'raises an error if its content is empty' do
19
+ template = "{% swfobject #{@test_data[:swf_url]} %}{% endswfobject %}"
20
+ assert_raises(ScriptError) do
21
+ p = Template.parse(template).render()
22
+ end
23
+
24
+ end
25
+
26
+ end
27
+
28
+ end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-swfobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-04 00:00:00.000000000 Z
11
+ date: 2013-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.3
19
+ version: 1.2.1
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.0.3
26
+ version: 1.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: 1.1.5
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: 1.1.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mocha
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: '0.14'
89
+ version: 0.14.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: '0.14'
96
+ version: 0.14.0
97
97
  description: Liquid plugin for using SWFObject with Jekyll
98
98
  email:
99
99
  - info@websector.de
@@ -113,6 +113,7 @@ files:
113
113
  - test/test_helper.rb
114
114
  - test/test_swfobject_tag_attributes.rb
115
115
  - test/test_swfobject_tag_config.rb
116
+ - test/test_swfobject_tag_content.rb
116
117
  homepage: https://github.com/sectore/jekyll-swfobject
117
118
  licenses:
118
119
  - MIT
@@ -123,17 +124,17 @@ require_paths:
123
124
  - lib
124
125
  required_ruby_version: !ruby/object:Gem::Requirement
125
126
  requirements:
126
- - - ! '>='
127
+ - - '>='
127
128
  - !ruby/object:Gem::Version
128
129
  version: 1.9.3
129
130
  required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  requirements:
131
- - - ! '>='
132
+ - - '>='
132
133
  - !ruby/object:Gem::Version
133
134
  version: '0'
134
135
  requirements: []
135
136
  rubyforge_project:
136
- rubygems_version: 2.0.3
137
+ rubygems_version: 2.0.6
137
138
  signing_key:
138
139
  specification_version: 4
139
140
  summary: SWFObject Tag is a Liquid plugin for Jekyll to embed Flash files (*.swf)
@@ -142,3 +143,4 @@ test_files:
142
143
  - test/test_helper.rb
143
144
  - test/test_swfobject_tag_attributes.rb
144
145
  - test/test_swfobject_tag_config.rb
146
+ - test/test_swfobject_tag_content.rb