sitemap_generator 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGES.md +250 -0
  3. data/README.md +156 -125
  4. data/VERSION +1 -1
  5. data/lib/capistrano/tasks/sitemap_generator.cap +21 -23
  6. data/lib/sitemap_generator.rb +1 -2
  7. data/lib/sitemap_generator/adapters/s3_adapter.rb +5 -0
  8. data/lib/sitemap_generator/application.rb +1 -1
  9. data/lib/sitemap_generator/builder/sitemap_file.rb +7 -3
  10. data/lib/sitemap_generator/builder/sitemap_url.rb +1 -10
  11. data/lib/sitemap_generator/link_set.rb +16 -10
  12. data/lib/sitemap_generator/{sitemap_namer.rb → simple_namer.rb} +1 -1
  13. data/lib/sitemap_generator/sitemap_location.rb +13 -1
  14. data/lib/sitemap_generator/tasks.rb +2 -2
  15. metadata +51 -123
  16. data/Gemfile +0 -13
  17. data/Gemfile.lock +0 -38
  18. data/Rakefile +0 -43
  19. data/spec/blueprint.rb +0 -15
  20. data/spec/files/sitemap.create.rb +0 -12
  21. data/spec/files/sitemap.groups.rb +0 -49
  22. data/spec/sitemap_generator/adapters/s3_adapter_spec.rb +0 -23
  23. data/spec/sitemap_generator/alternate_sitemap_spec.rb +0 -100
  24. data/spec/sitemap_generator/application_spec.rb +0 -69
  25. data/spec/sitemap_generator/builder/sitemap_file_spec.rb +0 -110
  26. data/spec/sitemap_generator/builder/sitemap_index_file_spec.rb +0 -124
  27. data/spec/sitemap_generator/builder/sitemap_index_url_spec.rb +0 -28
  28. data/spec/sitemap_generator/builder/sitemap_url_spec.rb +0 -192
  29. data/spec/sitemap_generator/core_ext/bigdecimal_spec.rb +0 -20
  30. data/spec/sitemap_generator/core_ext/numeric_spec.rb +0 -43
  31. data/spec/sitemap_generator/file_adaptor_spec.rb +0 -20
  32. data/spec/sitemap_generator/geo_sitemap_spec.rb +0 -30
  33. data/spec/sitemap_generator/helpers/number_helper_spec.rb +0 -196
  34. data/spec/sitemap_generator/interpreter_spec.rb +0 -90
  35. data/spec/sitemap_generator/link_set_spec.rb +0 -864
  36. data/spec/sitemap_generator/mobile_sitemap_spec.rb +0 -27
  37. data/spec/sitemap_generator/news_sitemap_spec.rb +0 -42
  38. data/spec/sitemap_generator/pagemap_sitemap_spec.rb +0 -57
  39. data/spec/sitemap_generator/sitemap_generator_spec.rb +0 -591
  40. data/spec/sitemap_generator/sitemap_groups_spec.rb +0 -144
  41. data/spec/sitemap_generator/sitemap_location_spec.rb +0 -210
  42. data/spec/sitemap_generator/sitemap_namer_spec.rb +0 -96
  43. data/spec/sitemap_generator/templates_spec.rb +0 -24
  44. data/spec/sitemap_generator/utilities/existence_spec.rb +0 -26
  45. data/spec/sitemap_generator/utilities/hash_spec.rb +0 -57
  46. data/spec/sitemap_generator/utilities/rounding_spec.rb +0 -31
  47. data/spec/sitemap_generator/utilities_spec.rb +0 -101
  48. data/spec/sitemap_generator/video_sitemap_spec.rb +0 -117
  49. data/spec/spec_helper.rb +0 -24
  50. data/spec/support/file_macros.rb +0 -39
  51. data/spec/support/schemas/siteindex.xsd +0 -73
  52. data/spec/support/schemas/sitemap-geo.xsd +0 -41
  53. data/spec/support/schemas/sitemap-mobile.xsd +0 -32
  54. data/spec/support/schemas/sitemap-news.xsd +0 -159
  55. data/spec/support/schemas/sitemap-pagemap.xsd +0 -97
  56. data/spec/support/schemas/sitemap-video.xsd +0 -643
  57. data/spec/support/schemas/sitemap.xsd +0 -115
  58. data/spec/support/xml_macros.rb +0 -67
@@ -1,196 +0,0 @@
1
- require 'spec_helper'
2
- require 'sitemap_generator/helpers/number_helper'
3
-
4
- def kilobytes(number)
5
- number * 1024
6
- end
7
-
8
- def megabytes(number)
9
- kilobytes(number) * 1024
10
- end
11
-
12
- def gigabytes(number)
13
- megabytes(number) * 1024
14
- end
15
-
16
- def terabytes(number)
17
- gigabytes(number) * 1024
18
- end
19
-
20
- describe SitemapGenerator::Helpers::NumberHelper do
21
- include SitemapGenerator::Helpers::NumberHelper
22
-
23
- it "should number_with_delimiter" do
24
- number_with_delimiter(12345678).should == "12,345,678"
25
- number_with_delimiter(0).should == "0"
26
- number_with_delimiter(123).should == "123"
27
- number_with_delimiter(123456).should == "123,456"
28
- number_with_delimiter(123456.78).should == "123,456.78"
29
- number_with_delimiter(123456.789).should == "123,456.789"
30
- number_with_delimiter(123456.78901).should == "123,456.78901"
31
- number_with_delimiter(123456789.78901).should == "123,456,789.78901"
32
- number_with_delimiter(0.78901).should == "0.78901"
33
- number_with_delimiter("123456.78").should == "123,456.78"
34
- end
35
-
36
- it "should number_with_delimiter_with_options_hash" do
37
- number_with_delimiter(12345678, :delimiter => ' ').should == '12 345 678'
38
- number_with_delimiter(12345678.05, :separator => '-').should == '12,345,678-05'
39
- number_with_delimiter(12345678.05, :separator => ',', :delimiter => '.').should == '12.345.678,05'
40
- number_with_delimiter(12345678.05, :delimiter => '.', :separator => ',').should == '12.345.678,05'
41
- end
42
-
43
- it "should number_with_precision" do
44
- number_with_precision(-111.2346).should == "-111.235"
45
- number_with_precision(111.2346).should == "111.235"
46
- number_with_precision(31.825, :precision => 2).should == "31.83"
47
- number_with_precision(111.2346, :precision => 2).should == "111.23"
48
- number_with_precision(111, :precision => 2).should == "111.00"
49
- number_with_precision("111.2346").should == "111.235"
50
- number_with_precision("31.825", :precision => 2).should == "31.83"
51
- number_with_precision((32.6751 * 100.00), :precision => 0).should == "3268"
52
- number_with_precision(111.50, :precision => 0).should == "112"
53
- number_with_precision(1234567891.50, :precision => 0).should == "1234567892"
54
- number_with_precision(0, :precision => 0).should == "0"
55
- number_with_precision(0.001, :precision => 5).should == "0.00100"
56
- number_with_precision(0.00111, :precision => 3).should == "0.001"
57
- # Odd difference between Ruby versions
58
- if RUBY_VERSION < '1.9.3'
59
- number_with_precision(9.995, :precision => 2).should == "9.99"
60
- else
61
- number_with_precision(9.995, :precision => 2).should == "10.00"
62
- end
63
- number_with_precision(10.995, :precision => 2).should == "11.00"
64
- end
65
-
66
- it "should number_with_precision_with_custom_delimiter_and_separator" do
67
- number_with_precision(31.825, :precision => 2, :separator => ',').should == '31,83'
68
- number_with_precision(1231.825, :precision => 2, :separator => ',', :delimiter => '.').should == '1.231,83'
69
- end
70
-
71
- it "should number_with_precision_with_significant_digits" do
72
- number_with_precision(123987, :precision => 3, :significant => true).should == "124000"
73
- number_with_precision(123987876, :precision => 2, :significant => true ).should == "120000000"
74
- number_with_precision("43523", :precision => 1, :significant => true ).should == "40000"
75
- number_with_precision(9775, :precision => 4, :significant => true ).should == "9775"
76
- number_with_precision(5.3923, :precision => 2, :significant => true ).should == "5.4"
77
- number_with_precision(5.3923, :precision => 1, :significant => true ).should == "5"
78
- number_with_precision(1.232, :precision => 1, :significant => true ).should == "1"
79
- number_with_precision(7, :precision => 1, :significant => true ).should == "7"
80
- number_with_precision(1, :precision => 1, :significant => true ).should == "1"
81
- number_with_precision(52.7923, :precision => 2, :significant => true ).should == "53"
82
- number_with_precision(9775, :precision => 6, :significant => true ).should == "9775.00"
83
- number_with_precision(5.3929, :precision => 7, :significant => true ).should == "5.392900"
84
- number_with_precision(0, :precision => 2, :significant => true ).should == "0.0"
85
- number_with_precision(0, :precision => 1, :significant => true ).should == "0"
86
- number_with_precision(0.0001, :precision => 1, :significant => true ).should == "0.0001"
87
- number_with_precision(0.0001, :precision => 3, :significant => true ).should == "0.000100"
88
- number_with_precision(0.0001111, :precision => 1, :significant => true ).should == "0.0001"
89
- number_with_precision(9.995, :precision => 3, :significant => true).should == "10.0"
90
- number_with_precision(9.994, :precision => 3, :significant => true).should == "9.99"
91
- number_with_precision(10.995, :precision => 3, :significant => true).should == "11.0"
92
- end
93
-
94
- it "should number_with_precision_with_strip_insignificant_zeros" do
95
- number_with_precision(9775.43, :precision => 4, :strip_insignificant_zeros => true ).should == "9775.43"
96
- number_with_precision(9775.2, :precision => 6, :significant => true, :strip_insignificant_zeros => true ).should == "9775.2"
97
- number_with_precision(0, :precision => 6, :significant => true, :strip_insignificant_zeros => true ).should == "0"
98
- end
99
-
100
- it "should number_with_precision_with_significant_true_and_zero_precision" do
101
- # Zero precision with significant is a mistake (would always return zero),
102
- # so we treat it as if significant was false (increases backwards compatibily for number_to_human_size)
103
- number_with_precision(123.987, :precision => 0, :significant => true).should == "124"
104
- number_with_precision(12, :precision => 0, :significant => true ).should == "12"
105
- number_with_precision("12.3", :precision => 0, :significant => true ).should == "12"
106
- end
107
-
108
- it "should number_to_human_size" do
109
- number_to_human_size(0).should == '0 Bytes'
110
- number_to_human_size(1).should == '1 Byte'
111
- number_to_human_size(3.14159265).should == '3 Bytes'
112
- number_to_human_size(123.0).should == '123 Bytes'
113
- number_to_human_size(123).should == '123 Bytes'
114
- number_to_human_size(1234).should == '1.21 KB'
115
- number_to_human_size(12345).should == '12.1 KB'
116
- number_to_human_size(1234567).should == '1.18 MB'
117
- number_to_human_size(1234567890).should == '1.15 GB'
118
- number_to_human_size(1234567890123).should == '1.12 TB'
119
- number_to_human_size(terabytes(1026)).should == '1030 TB'
120
- number_to_human_size(kilobytes(444)).should == '444 KB'
121
- number_to_human_size(megabytes(1023)).should == '1020 MB'
122
- number_to_human_size(terabytes(3)).should == '3 TB'
123
- number_to_human_size(1234567, :precision => 2).should == '1.2 MB'
124
- number_to_human_size(3.14159265, :precision => 4).should == '3 Bytes'
125
- number_to_human_size('123').should == '123 Bytes'
126
- number_to_human_size(kilobytes(1.0123), :precision => 2).should == '1 KB'
127
- number_to_human_size(kilobytes(1.0100), :precision => 4).should == '1.01 KB'
128
- number_to_human_size(kilobytes(10.000), :precision => 4).should == '10 KB'
129
- number_to_human_size(1.1).should == '1 Byte'
130
- number_to_human_size(10).should == '10 Bytes'
131
- end
132
-
133
- it "should number_to_human_size_with_options_hash" do
134
- number_to_human_size(1234567, :precision => 2).should == '1.2 MB'
135
- number_to_human_size(3.14159265, :precision => 4).should == '3 Bytes'
136
- number_to_human_size(kilobytes(1.0123), :precision => 2).should == '1 KB'
137
- number_to_human_size(kilobytes(1.0100), :precision => 4).should == '1.01 KB'
138
- number_to_human_size(kilobytes(10.000), :precision => 4).should == '10 KB'
139
- number_to_human_size(1234567890123, :precision => 1).should == '1 TB'
140
- number_to_human_size(524288000, :precision=>3).should == '500 MB'
141
- number_to_human_size(9961472, :precision=>0).should == '10 MB'
142
- number_to_human_size(41010, :precision => 1).should == '40 KB'
143
- number_to_human_size(41100, :precision => 2).should == '40 KB'
144
- number_to_human_size(kilobytes(1.0123), :precision => 2, :strip_insignificant_zeros => false).should == '1.0 KB'
145
- number_to_human_size(kilobytes(1.0123), :precision => 3, :significant => false).should == '1.012 KB'
146
- number_to_human_size(kilobytes(1.0123), :precision => 0, :significant => true) #ignores significant it precision is 0.should == '1 KB'
147
- end
148
-
149
- it "should number_to_human_size_with_custom_delimiter_and_separator" do
150
- number_to_human_size(kilobytes(1.0123), :precision => 3, :separator => ',') .should == '1,01 KB'
151
- number_to_human_size(kilobytes(1.0100), :precision => 4, :separator => ',') .should == '1,01 KB'
152
- number_to_human_size(terabytes(1000.1), :precision => 5, :delimiter => '.', :separator => ',') .should == '1.000,1 TB'
153
- end
154
-
155
- it "should number_helpers_should_return_nil_when_given_nil" do
156
- number_with_delimiter(nil).should be_nil
157
- number_with_precision(nil).should be_nil
158
- number_to_human_size(nil).should be_nil
159
- end
160
-
161
- it "should number_helpers_should_return_non_numeric_param_unchanged" do
162
- number_with_delimiter("x").should == "x"
163
- number_with_precision("x.").should == "x."
164
- number_with_precision("x").should == "x"
165
- number_to_human_size('x').should == "x"
166
- end
167
-
168
- it "should number_helpers_should_raise_error_if_invalid_when_specified" do
169
- lambda do
170
- number_to_human_size("x", :raise => true)
171
- end.should raise_error(SitemapGenerator::Helpers::NumberHelper::InvalidNumberError)
172
- begin
173
- number_to_human_size("x", :raise => true)
174
- rescue SitemapGenerator::Helpers::NumberHelper::InvalidNumberError => e
175
- e.number.should == "x"
176
- end
177
-
178
- lambda do
179
- number_with_precision("x", :raise => true)
180
- end.should raise_error(SitemapGenerator::Helpers::NumberHelper::InvalidNumberError)
181
- begin
182
- number_with_precision("x", :raise => true)
183
- rescue SitemapGenerator::Helpers::NumberHelper::InvalidNumberError => e
184
- e.number.should == "x"
185
- end
186
-
187
- lambda do
188
- number_with_delimiter("x", :raise => true)
189
- end.should raise_error(SitemapGenerator::Helpers::NumberHelper::InvalidNumberError)
190
- begin
191
- number_with_delimiter("x", :raise => true)
192
- rescue SitemapGenerator::Helpers::NumberHelper::InvalidNumberError => e
193
- e.number.should == "x"
194
- end
195
- end
196
- end
@@ -1,90 +0,0 @@
1
- require 'spec_helper'
2
- require 'sitemap_generator/interpreter'
3
-
4
- describe SitemapGenerator::Interpreter do
5
- let(:link_set) { SitemapGenerator::LinkSet.new }
6
- let(:interpreter) { SitemapGenerator::Interpreter.new(:link_set => link_set) }
7
-
8
- # The interpreter doesn't have the URL helpers included for some reason, so it
9
- # fails when adding links. That messes up later specs unless we reset the sitemap object.
10
- after :all do
11
- SitemapGenerator::Sitemap.reset!
12
- end
13
-
14
- it "should find the config file if Rails.root doesn't end in a slash" do
15
- SitemapGenerator::Utilities.with_warnings(nil) do
16
- Rails = stub(:root => SitemapGenerator.app.root.to_s.sub(/\/$/, ''))
17
- end
18
- # Rails.expects(:root).returns(rails_root).at_least_once
19
- lambda { SitemapGenerator::Interpreter.run }.should_not raise_exception(Errno::ENOENT)
20
- end
21
-
22
- it "should set the verbose option" do
23
- SitemapGenerator::Interpreter.any_instance.expects(:instance_eval)
24
- interpreter = SitemapGenerator::Interpreter.run(:verbose => true)
25
- interpreter.instance_variable_get(:@linkset).verbose.should be_true
26
- end
27
-
28
- describe "link_set" do
29
- it "should default to the default LinkSet" do
30
- SitemapGenerator::Interpreter.new.sitemap.should be(SitemapGenerator::Sitemap)
31
- end
32
-
33
- it "should allow setting the LinkSet as an option" do
34
- interpreter.sitemap.should be(link_set)
35
- end
36
- end
37
-
38
- describe "public interface" do
39
- describe "add" do
40
- it "should add a link to the sitemap" do
41
- link_set.expects(:add).with('test', :option => 'value')
42
- interpreter.add('test', :option => 'value')
43
- end
44
- end
45
-
46
- describe "group" do
47
- it "should start a new group" do
48
- link_set.expects(:group).with('test', :option => 'value')
49
- interpreter.group('test', :option => 'value')
50
- end
51
- end
52
-
53
- describe "sitemap" do
54
- it "should return the LinkSet" do
55
- interpreter.sitemap.should be(link_set)
56
- end
57
- end
58
-
59
- describe "add_to_index" do
60
- it "should add a link to the sitemap index" do
61
- link_set.expects(:add_to_index).with('test', :option => 'value')
62
- interpreter.add_to_index('test', :option => 'value')
63
- end
64
- end
65
- end
66
-
67
- describe "eval" do
68
- it "should yield the LinkSet to the block" do
69
- interpreter.eval(:yield_sitemap => true) do |sitemap|
70
- sitemap.should be(link_set)
71
- end
72
- end
73
-
74
- it "should not yield the LinkSet to the block" do
75
- local = interpreter # prevent undefined method
76
- local_be = self.method(:be) # prevent undefined method
77
- local.eval(:yield_sitemap => false) do
78
- self.should local_be.call(local)
79
- end
80
- end
81
-
82
- it "should not yield the LinkSet to the block by default" do
83
- local = interpreter # prevent undefined method
84
- local_be = self.method(:be) # prevent undefined method
85
- local.eval do
86
- self.should local_be.call(local)
87
- end
88
- end
89
- end
90
- end
@@ -1,864 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe SitemapGenerator::LinkSet do
4
- let(:default_host) { 'http://example.com' }
5
- let(:ls) { SitemapGenerator::LinkSet.new(:default_host => default_host) }
6
-
7
- describe "initializer options" do
8
- options = [:public_path, :sitemaps_path, :default_host, :filename, :search_engines]
9
- values = [File.expand_path(SitemapGenerator.app.root + 'tmp/'), 'mobile/', 'http://myhost.com', :xxx, { :abc => '123' }]
10
-
11
- options.zip(values).each do |option, value|
12
- it "should set #{option} to #{value}" do
13
- ls = SitemapGenerator::LinkSet.new(option => value)
14
- ls.send(option).should == value
15
- end
16
- end
17
- end
18
-
19
- describe "default options" do
20
- let(:ls) { SitemapGenerator::LinkSet.new }
21
-
22
- default_options = {
23
- :filename => :sitemap,
24
- :sitemaps_path => nil,
25
- :public_path => SitemapGenerator.app.root + 'public/',
26
- :default_host => nil,
27
- :include_index => false,
28
- :include_root => true,
29
- :create_index => :auto
30
- }
31
-
32
- default_options.each do |option, value|
33
- it "#{option} should default to #{value}" do
34
- ls.send(option).should == value
35
- end
36
- end
37
- end
38
-
39
- describe "include_root include_index option" do
40
- it "should include the root url and the sitemap index url" do
41
- ls = SitemapGenerator::LinkSet.new(:default_host => default_host, :include_root => true, :include_index => true)
42
- ls.include_root.should be_true
43
- ls.include_index.should be_true
44
- ls.create { |sitemap| }
45
- ls.sitemap.link_count.should == 2
46
- end
47
-
48
- it "should not include the root url" do
49
- ls = SitemapGenerator::LinkSet.new(:default_host => default_host, :include_root => false)
50
- ls.include_root.should be_false
51
- ls.include_index.should be_false
52
- ls.create { |sitemap| }
53
- ls.sitemap.link_count.should == 0
54
- end
55
-
56
- it "should not include the sitemap index url" do
57
- ls = SitemapGenerator::LinkSet.new(:default_host => default_host, :include_index => false)
58
- ls.include_root.should be_true
59
- ls.include_index.should be_false
60
- ls.create { |sitemap| }
61
- ls.sitemap.link_count.should == 1
62
- end
63
-
64
- it "should not include the root url or the sitemap index url" do
65
- ls = SitemapGenerator::LinkSet.new(:default_host => default_host, :include_root => false, :include_index => false)
66
- ls.include_root.should be_false
67
- ls.include_index.should be_false
68
- ls.create { |sitemap| }
69
- ls.sitemap.link_count.should == 0
70
- end
71
- end
72
-
73
- describe "sitemaps public_path" do
74
- it "should default to public/" do
75
- path = SitemapGenerator.app.root + 'public/'
76
- ls.public_path.should == path
77
- ls.sitemap.location.public_path.should == path
78
- ls.sitemap_index.location.public_path.should == path
79
- end
80
-
81
- it "should change when the public_path is changed" do
82
- path = SitemapGenerator.app.root + 'tmp/'
83
- ls.public_path = 'tmp/'
84
- ls.public_path.should == path
85
- ls.sitemap.location.public_path.should == path
86
- ls.sitemap_index.location.public_path.should == path
87
- end
88
-
89
- it "should append a slash to the path" do
90
- path = SitemapGenerator.app.root + 'tmp/'
91
- ls.public_path = 'tmp'
92
- ls.public_path.should == path
93
- ls.sitemap.location.public_path.should == path
94
- ls.sitemap_index.location.public_path.should == path
95
- end
96
- end
97
-
98
- describe "sitemaps url" do
99
- it "should change when the default_host is changed" do
100
- ls.default_host = 'http://one.com'
101
- ls.default_host.should == 'http://one.com'
102
- ls.default_host.should == ls.sitemap.location.host
103
- ls.default_host.should == ls.sitemap_index.location.host
104
- end
105
-
106
- it "should change when the sitemaps_path is changed" do
107
- ls.default_host = 'http://one.com'
108
- ls.sitemaps_path = 'sitemaps/'
109
- ls.sitemap.location.url.should == 'http://one.com/sitemaps/sitemap.xml.gz'
110
- ls.sitemap_index.location.url.should == 'http://one.com/sitemaps/sitemap.xml.gz'
111
- end
112
-
113
- it "should append a slash to the path" do
114
- ls.default_host = 'http://one.com'
115
- ls.sitemaps_path = 'sitemaps'
116
- ls.sitemap.location.url.should == 'http://one.com/sitemaps/sitemap.xml.gz'
117
- ls.sitemap_index.location.url.should == 'http://one.com/sitemaps/sitemap.xml.gz'
118
- end
119
- end
120
-
121
- describe "sitemap_index_url" do
122
- it "should return the url to the index file" do
123
- ls.default_host = default_host
124
- ls.sitemap_index.location.url.should == "#{default_host}/sitemap.xml.gz"
125
- ls.sitemap_index_url.should == ls.sitemap_index.location.url
126
- end
127
- end
128
-
129
- describe "search_engines" do
130
- it "should have search engines by default" do
131
- ls.search_engines.should be_a(Hash)
132
- ls.search_engines.size.should == 2
133
- end
134
-
135
- it "should support being modified" do
136
- ls.search_engines[:newengine] = 'abc'
137
- ls.search_engines.size.should == 3
138
- end
139
-
140
- it "should support being set to nil" do
141
- ls = SitemapGenerator::LinkSet.new(:default_host => 'http://one.com', :search_engines => nil)
142
- ls.search_engines.should be_a(Hash)
143
- ls.search_engines.should be_empty
144
- ls.search_engines = nil
145
- ls.search_engines.should be_a(Hash)
146
- ls.search_engines.should be_empty
147
- end
148
- end
149
-
150
- describe "ping search engines" do
151
- it "should not fail" do
152
- ls.expects(:open).at_least_once
153
- lambda { ls.ping_search_engines }.should_not raise_error
154
- end
155
-
156
- it "should raise if no host is set" do
157
- lambda { SitemapGenerator::LinkSet.new.ping_search_engines }.should raise_error(SitemapGenerator::SitemapError, 'No value set for host')
158
- end
159
-
160
- it "should use the sitemap index url provided" do
161
- index_url = 'http://example.com/index.xml'
162
- ls = SitemapGenerator::LinkSet.new(:search_engines => { :google => 'http://google.com/?url=%s' })
163
- ls.expects(:open).with("http://google.com/?url=#{CGI.escape(index_url)}")
164
- ls.ping_search_engines(index_url)
165
- end
166
-
167
- it "should use the sitemap index url from the link set" do
168
- ls = SitemapGenerator::LinkSet.new(
169
- :default_host => default_host,
170
- :search_engines => { :google => 'http://google.com/?url=%s' })
171
- index_url = ls.sitemap_index_url
172
- ls.expects(:open).with("http://google.com/?url=#{CGI.escape(index_url)}")
173
- ls.ping_search_engines
174
- end
175
-
176
- it "should include the given search engines" do
177
- ls.search_engines = nil
178
- ls.expects(:open).with(regexp_matches(/^http:\/\/newnegine\.com\?/))
179
- ls.ping_search_engines(:newengine => 'http://newnegine.com?%s')
180
-
181
- ls.expects(:open).with(regexp_matches(/^http:\/\/newnegine\.com\?/)).twice
182
- ls.ping_search_engines(:newengine => 'http://newnegine.com?%s', :anotherengine => 'http://newnegine.com?%s')
183
- end
184
- end
185
-
186
- describe "verbose" do
187
- it "should be set as an initialize option" do
188
- SitemapGenerator::LinkSet.new(:default_host => default_host, :verbose => false).verbose.should be_false
189
- SitemapGenerator::LinkSet.new(:default_host => default_host, :verbose => true).verbose.should be_true
190
- end
191
-
192
- it "should be set as an accessor" do
193
- ls.verbose = true
194
- ls.verbose.should be_true
195
- ls.verbose = false
196
- ls.verbose.should be_false
197
- end
198
-
199
- it "should use SitemapGenerator.verbose as a default" do
200
- SitemapGenerator.expects(:verbose).returns(true).at_least_once
201
- SitemapGenerator::LinkSet.new.verbose.should be_true
202
- SitemapGenerator.expects(:verbose).returns(false).at_least_once
203
- SitemapGenerator::LinkSet.new.verbose.should be_false
204
- end
205
- end
206
-
207
- describe "when finalizing" do
208
- let(:ls) { SitemapGenerator::LinkSet.new(:default_host => default_host, :verbose => true, :create_index => true) }
209
-
210
- it "should output summary lines" do
211
- ls.sitemap.location.expects(:summary)
212
- ls.sitemap_index.location.expects(:summary)
213
- ls.finalize!
214
- end
215
- end
216
-
217
- describe "sitemaps host" do
218
- let(:new_host) { 'http://wowza.com' }
219
-
220
- it "should have a host" do
221
- ls.default_host = default_host
222
- ls.default_host.should == default_host
223
- end
224
-
225
- it "should default to default host" do
226
- ls.sitemaps_host.should == ls.default_host
227
- end
228
-
229
- it "should update the host in the sitemaps when changed" do
230
- ls.sitemaps_host = new_host
231
- ls.sitemaps_host.should == new_host
232
- ls.sitemap.location.host.should == ls.sitemaps_host
233
- ls.sitemap_index.location.host.should == ls.sitemaps_host
234
- end
235
-
236
- it "should not change the default host for links" do
237
- ls.sitemaps_host = new_host
238
- ls.default_host.should == default_host
239
- end
240
- end
241
-
242
- describe "with a sitemap index specified" do
243
- before :each do
244
- @index = SitemapGenerator::Builder::SitemapIndexFile.new(:host => default_host)
245
- @ls = SitemapGenerator::LinkSet.new(:sitemap_index => @index, :sitemaps_host => 'http://newhost.com')
246
- end
247
-
248
- it "should not modify the index" do
249
- @ls.filename = :newname
250
- @ls.sitemap.location.filename.should =~ /newname/
251
- @ls.sitemap_index.location.filename =~ /sitemap/
252
- end
253
-
254
- it "should not modify the index" do
255
- @ls.sitemaps_host = 'http://newhost.com'
256
- @ls.sitemap.location.host.should == 'http://newhost.com'
257
- @ls.sitemap_index.location.host.should == default_host
258
- end
259
-
260
- it "should not finalize the index" do
261
- @ls.send(:finalize_sitemap_index!)
262
- @ls.sitemap_index.finalized?.should be_false
263
- end
264
- end
265
-
266
- describe "new group" do
267
- describe "general behaviour" do
268
- it "should return a LinkSet" do
269
- ls.group.should be_a(SitemapGenerator::LinkSet)
270
- end
271
-
272
- it "should inherit the index" do
273
- ls.group.sitemap_index.should == ls.sitemap_index
274
- end
275
-
276
- it "should protect the sitemap_index" do
277
- ls.group.instance_variable_get(:@protect_index).should be_true
278
- end
279
-
280
- it "should not allow chaning the public_path" do
281
- ls.group(:public_path => 'new/path/').public_path.to_s.should == ls.public_path.to_s
282
- end
283
- end
284
-
285
- describe "include_index" do
286
- it "should set the value" do
287
- ls.group(:include_index => !ls.include_index).include_index.should_not == ls.include_index
288
- end
289
-
290
- it "should default to false" do
291
- ls.group.include_index.should be_false
292
- end
293
- end
294
-
295
- describe "include_root" do
296
- it "should set the value" do
297
- ls.group(:include_root => !ls.include_root).include_root.should_not == ls.include_root
298
- end
299
-
300
- it "should default to false" do
301
- ls.group.include_root.should be_false
302
- end
303
- end
304
-
305
- describe "filename" do
306
- it "should inherit the value" do
307
- ls.group.filename.should == :sitemap
308
- end
309
-
310
- it "should set the value" do
311
- group = ls.group(:filename => :xxx)
312
- group.filename.should == :xxx
313
- group.sitemap.location.filename.should =~ /xxx/
314
- end
315
- end
316
-
317
- describe "verbose" do
318
- it "should inherit the value" do
319
- ls.group.verbose.should == ls.verbose
320
- end
321
-
322
- it "should set the value" do
323
- ls.group(:verbose => !ls.verbose).verbose.should_not == ls.verbose
324
- end
325
- end
326
-
327
- describe "sitemaps_path" do
328
- it "should inherit the sitemaps_path" do
329
- group = ls.group
330
- group.sitemaps_path.should == ls.sitemaps_path
331
- group.sitemap.location.sitemaps_path.should == ls.sitemap.location.sitemaps_path
332
- end
333
-
334
- it "should set the sitemaps_path" do
335
- path = 'new/path'
336
- group = ls.group(:sitemaps_path => path)
337
- group.sitemaps_path.should == path
338
- group.sitemap.location.sitemaps_path.to_s.should == 'new/path/'
339
- end
340
- end
341
-
342
- describe "default_host" do
343
- it "should inherit the default_host" do
344
- ls.group.default_host.should == default_host
345
- end
346
-
347
- it "should set the default_host" do
348
- host = 'http://defaulthost.com'
349
- group = ls.group(:default_host => host)
350
- group.default_host.should == host
351
- group.sitemap.location.host.should == host
352
- end
353
- end
354
-
355
- describe "sitemaps_host" do
356
- it "should set the sitemaps host" do
357
- @host = 'http://sitemaphost.com'
358
- @group = ls.group(:sitemaps_host => @host)
359
- @group.sitemaps_host.should == @host
360
- @group.sitemap.location.host.should == @host
361
- end
362
-
363
- it "should finalize the sitemap if it is the only option" do
364
- ls.expects(:finalize_sitemap!)
365
- ls.group(:sitemaps_host => 'http://test.com') {}
366
- end
367
-
368
- it "should use the same namer" do
369
- @group = ls.group(:sitemaps_host => 'http://test.com') {}
370
- @group.sitemap.location.namer.should == ls.sitemap.location.namer
371
- end
372
- end
373
-
374
- describe "namer" do
375
- it "should inherit the value" do
376
- ls.group.namer.should == ls.namer
377
- ls.group.sitemap.location.namer.should == ls.namer
378
- end
379
-
380
- it "should set the value" do
381
- namer = SitemapGenerator::SimpleNamer.new(:xxx)
382
- group = ls.group(:namer => namer)
383
- group.namer.should == namer
384
- group.sitemap.location.namer.should == namer
385
- group.sitemap.location.filename.should =~ /xxx/
386
- end
387
- end
388
-
389
- describe "create_index" do
390
- it "should inherit the value" do
391
- ls.group.create_index.should == ls.create_index
392
- ls.create_index = :some_value
393
- ls.group.create_index.should == :some_value
394
- end
395
-
396
- it "should set the value" do
397
- group = ls.group(:create_index => :some_value)
398
- group.create_index.should == :some_value
399
- end
400
- end
401
-
402
- describe "should share the current sitemap" do
403
- it "if only default_host is passed" do
404
- group = ls.group(:default_host => 'http://newhost.com')
405
- group.sitemap.should == ls.sitemap
406
- group.sitemap.location.host.should == 'http://newhost.com'
407
- end
408
- end
409
-
410
- describe "should not share the current sitemap" do
411
- {
412
- :filename => :xxx,
413
- :sitemaps_path => 'en/',
414
- :filename => :example,
415
- :namer => SitemapGenerator::SimpleNamer.new(:sitemap)
416
- }.each do |key, value|
417
- it "if #{key} is present" do
418
- ls.group(key => value).sitemap.should_not == ls.sitemap
419
- end
420
- end
421
- end
422
-
423
- describe "finalizing" do
424
- it "should only finalize the sitemaps if a block is passed" do
425
- @group = ls.group
426
- @group.sitemap.finalized?.should be_false
427
- end
428
-
429
- it "should not finalize the sitemap if a group is created" do
430
- ls.create { group {} }
431
- ls.sitemap.empty?.should be_true
432
- ls.sitemap.finalized?.should be_false
433
- end
434
-
435
- {:sitemaps_path => 'en/',
436
- :filename => :example,
437
- :namer => SitemapGenerator::SimpleNamer.new(:sitemap)
438
- }.each do |k, v|
439
-
440
- it "should not finalize the sitemap if #{k} is present" do
441
- ls.expects(:finalize_sitemap!).never
442
- ls.group(k => v) { }
443
- end
444
- end
445
- end
446
-
447
- describe "adapter" do
448
- it "should inherit the current adapter" do
449
- ls.adapter = mock('adapter')
450
- group = ls.group
451
- group.should_not be(ls)
452
- group.adapter.should be(ls.adapter)
453
- end
454
-
455
- it "should set the value" do
456
- adapter = mock('adapter')
457
- group = ls.group(:adapter => adapter)
458
- group.adapter.should be(adapter)
459
- end
460
- end
461
- end
462
-
463
- describe "after create" do
464
- it "should finalize the sitemap index" do
465
- ls.create {}
466
- ls.sitemap_index.finalized?.should be_true
467
- end
468
-
469
- it "should finalize the sitemap" do
470
- ls.create {}
471
- ls.sitemap.finalized?.should be_true
472
- end
473
-
474
- it "should not finalize the sitemap if a group was created" do
475
- ls.instance_variable_set(:@created_group, true)
476
- ls.send(:finalize_sitemap!)
477
- ls.sitemap.finalized?.should be_false
478
- end
479
- end
480
-
481
- describe "options to create" do
482
- before :each do
483
- ls.stubs(:finalize!)
484
- end
485
-
486
- it "should set include_index" do
487
- original = ls.include_index
488
- ls.create(:include_index => !original).include_index.should_not == original
489
- end
490
-
491
- it "should set include_root" do
492
- original = ls.include_root
493
- ls.create(:include_root => !original).include_root.should_not == original
494
- end
495
-
496
- it "should set the filename" do
497
- ls.create(:filename => :xxx)
498
- ls.filename.should == :xxx
499
- ls.sitemap.location.filename.should =~ /xxx/
500
- end
501
-
502
- it "should set verbose" do
503
- original = ls.verbose
504
- ls.create(:verbose => !original).verbose.should_not == original
505
- end
506
-
507
- it "should set the sitemaps_path" do
508
- path = 'new/path'
509
- ls.create(:sitemaps_path => path)
510
- ls.sitemaps_path.should == path
511
- ls.sitemap.location.sitemaps_path.to_s.should == 'new/path/'
512
- end
513
-
514
- it "should set the default_host" do
515
- host = 'http://defaulthost.com'
516
- ls.create(:default_host => host)
517
- ls.default_host.should == host
518
- ls.sitemap.location.host.should == host
519
- end
520
-
521
- it "should set the sitemaps host" do
522
- host = 'http://sitemaphost.com'
523
- ls.create(:sitemaps_host => host)
524
- ls.sitemaps_host.should == host
525
- ls.sitemap.location.host.should == host
526
- end
527
-
528
- it "should set the namer" do
529
- namer = SitemapGenerator::SimpleNamer.new(:xxx)
530
- ls.create(:namer => namer)
531
- ls.namer.should == namer
532
- ls.sitemap.location.namer.should == namer
533
- ls.sitemap.location.filename.should =~ /xxx/
534
- end
535
-
536
- it "should support both namer and filename options" do
537
- namer = SitemapGenerator::SimpleNamer.new("sitemap2")
538
- ls.create(:namer => namer, :filename => "sitemap1")
539
- ls.namer.should == namer
540
- ls.sitemap.location.namer.should == namer
541
- ls.sitemap.location.filename.should =~ /^sitemap2/
542
- ls.sitemap_index.location.filename.should =~ /^sitemap2/
543
- end
544
-
545
- it "should support both namer and filename options no matter the order" do
546
- options = {
547
- :namer => SitemapGenerator::SimpleNamer.new('sitemap1'),
548
- :filename => 'sitemap2'
549
- }
550
- ls.create(options)
551
- ls.sitemap.location.filename.should =~ /^sitemap1/
552
- ls.sitemap_index.location.filename.should =~ /^sitemap1/
553
- end
554
-
555
- it "should not modify the options hash" do
556
- options = { :filename => 'sitemaptest', :verbose => false }
557
- ls.create(options)
558
- options.should == { :filename => 'sitemaptest', :verbose => false }
559
- end
560
-
561
- it "should set create_index" do
562
- ls.create(:create_index => :auto)
563
- ls.create_index.should == :auto
564
- end
565
- end
566
-
567
- describe "reset!" do
568
- it "should reset the sitemap namer" do
569
- SitemapGenerator::Sitemap.namer.expects(:reset)
570
- SitemapGenerator::Sitemap.create(:default_host => 'http://cnn.com')
571
- end
572
-
573
- it "should reset the default link variable" do
574
- SitemapGenerator::Sitemap.instance_variable_set(:@added_default_links, true)
575
- SitemapGenerator::Sitemap.create(:default_host => 'http://cnn.com')
576
- SitemapGenerator::Sitemap.instance_variable_set(:@added_default_links, false)
577
- end
578
- end
579
-
580
- describe "include_root?" do
581
- it "should return false" do
582
- ls.include_root = false
583
- ls.include_root.should be_false
584
- end
585
-
586
- it "should return true" do
587
- ls.include_root = true
588
- ls.include_root.should be_true
589
- end
590
- end
591
-
592
- describe "include_index?" do
593
- let(:sitemaps_host) { 'http://amazon.com' }
594
-
595
- it "should be true if no sitemaps_host set, or it is the same" do
596
- ls.include_index = true
597
- ls.sitemaps_host = default_host
598
- ls.include_index?.should be_true
599
-
600
- ls.sitemaps_host = nil
601
- ls.include_index?.should be_true
602
- end
603
-
604
- it "should be false if include_index is false or sitemaps_host differs" do
605
- ls.include_index = false
606
- ls.sitemaps_host = default_host
607
- ls.include_index?.should be_false
608
-
609
- ls.include_index = true
610
- ls.sitemaps_host = sitemaps_host
611
- ls.include_index?.should be_false
612
- end
613
-
614
- it "should return false" do
615
- ls = SitemapGenerator::LinkSet.new(:default_host => default_host, :sitemaps_host => sitemaps_host)
616
- ls.include_index?.should be_false
617
- end
618
- end
619
-
620
- describe "output" do
621
- it "should not output" do
622
- ls.verbose = false
623
- ls.expects(:puts).never
624
- ls.send(:output, '')
625
- end
626
-
627
- it "should print the given string" do
628
- ls.verbose = true
629
- ls.expects(:puts).with('')
630
- ls.send(:output, '')
631
- end
632
- end
633
-
634
- describe "yield_sitemap" do
635
- it "should default to the value of SitemapGenerator.yield_sitemap?" do
636
- SitemapGenerator.expects(:yield_sitemap?).returns(true)
637
- ls.yield_sitemap?.should be_true
638
- SitemapGenerator.expects(:yield_sitemap?).returns(false)
639
- ls.yield_sitemap?.should be_false
640
- end
641
-
642
- it "should be settable as an option" do
643
- SitemapGenerator.expects(:yield_sitemap?).never
644
- SitemapGenerator::LinkSet.new(:yield_sitemap => true).yield_sitemap?.should be_true
645
- SitemapGenerator::LinkSet.new(:yield_sitemap => false).yield_sitemap?.should be_false
646
- end
647
-
648
- it "should be settable as an attribute" do
649
- ls.yield_sitemap = true
650
- ls.yield_sitemap?.should be_true
651
- ls.yield_sitemap = false
652
- ls.yield_sitemap?.should be_false
653
- end
654
-
655
- it "should yield the sitemap in the call to create" do
656
- ls.send(:interpreter).expects(:eval).with(:yield_sitemap => true)
657
- ls.yield_sitemap = true
658
- ls.create
659
- ls.send(:interpreter).expects(:eval).with(:yield_sitemap => false)
660
- ls.yield_sitemap = false
661
- ls.create
662
- end
663
- end
664
-
665
- describe "add" do
666
- it "should not modify the options hash" do
667
- options = { :host => 'http://newhost.com' }
668
- ls.add('/home', options)
669
- options.should == { :host => 'http://newhost.com' }
670
- end
671
-
672
- it "should add the link to the sitemap and include the default host" do
673
- ls.stubs(:add_default_links)
674
- ls.sitemap.expects(:add).with('/home', :host => ls.default_host)
675
- ls.add('/home')
676
- end
677
-
678
- it "should allow setting of a custom host" do
679
- ls.stubs(:add_default_links)
680
- ls.sitemap.expects(:add).with('/home', :host => 'http://newhost.com')
681
- ls.add('/home', :host => 'http://newhost.com')
682
- end
683
-
684
- it "should add the default links if they have not been added" do
685
- ls.expects(:add_default_links)
686
- ls.add('/home')
687
- end
688
- end
689
-
690
- describe "add_to_index" do
691
- it "should add the link to the sitemap index and pass options" do
692
- ls.sitemap_index.expects(:add).with('/test', has_entry(:option => 'value'))
693
- ls.add_to_index('/test', :option => 'value')
694
- end
695
-
696
- it "should not modify the options hash" do
697
- options = { :host => 'http://newhost.com' }
698
- ls.add_to_index('/home', options)
699
- options.should == { :host => 'http://newhost.com' }
700
- end
701
-
702
- describe "host" do
703
- it "should be the sitemaps_host" do
704
- ls.sitemaps_host = 'http://sitemapshost.com'
705
- ls.sitemap_index.expects(:add).with('/home', :host => 'http://sitemapshost.com')
706
- ls.add_to_index('/home')
707
- end
708
-
709
- it "should be the default_host if no sitemaps_host set" do
710
- ls.sitemap_index.expects(:add).with('/home', :host => ls.default_host)
711
- ls.add_to_index('/home')
712
- end
713
-
714
- it "should allow setting a custom host" do
715
- ls.sitemap_index.expects(:add).with('/home', :host => 'http://newhost.com')
716
- ls.add_to_index('/home', :host => 'http://newhost.com')
717
- end
718
- end
719
- end
720
-
721
- describe "create_index" do
722
- let(:location) { SitemapGenerator::SitemapLocation.new(:namer => SitemapGenerator::SimpleNamer.new(:sitemap), :public_path => 'tmp/', :sitemaps_path => 'test/', :host => 'http://example.com/') }
723
- let(:sitemap) { SitemapGenerator::Builder::SitemapFile.new(location) }
724
-
725
- describe "when false" do
726
- let(:ls) { SitemapGenerator::LinkSet.new(:default_host => default_host, :create_index => false) }
727
-
728
- it "should not write the index" do
729
- ls.send(:finalize_sitemap_index!)
730
- ls.sitemap_index.written?.should be_false
731
- end
732
-
733
- it "should still add finalized sitemaps to the index (but the index is never finalized)" do
734
- ls.expects(:add_to_index).with(ls.sitemap).once
735
- ls.send(:finalize_sitemap!)
736
- end
737
- end
738
-
739
- describe "when true" do
740
- let(:ls) { SitemapGenerator::LinkSet.new(:default_host => default_host, :create_index => true) }
741
-
742
- it "should always finalize the index" do
743
- ls.send(:finalize_sitemap_index!)
744
- ls.sitemap_index.finalized?.should be_true
745
- end
746
-
747
- it "should add finalized sitemaps to the index" do
748
- ls.expects(:add_to_index).with(ls.sitemap).once
749
- ls.send(:finalize_sitemap!)
750
- end
751
- end
752
-
753
- describe "when :auto" do
754
- let(:ls) { SitemapGenerator::LinkSet.new(:default_host => default_host, :create_index => :auto) }
755
-
756
- it "should not write the index when it is empty" do
757
- ls.sitemap_index.empty?.should be_true
758
- ls.send(:finalize_sitemap_index!)
759
- ls.sitemap_index.written?.should be_false
760
- end
761
-
762
- it "should add finalized sitemaps to the index" do
763
- ls.expects(:add_to_index).with(ls.sitemap).once
764
- ls.send(:finalize_sitemap!)
765
- end
766
-
767
- it "should write the index when a link is added manually" do
768
- ls.sitemap_index.add '/test'
769
- ls.sitemap_index.empty?.should be_false
770
- ls.send(:finalize_sitemap_index!)
771
- ls.sitemap_index.written?.should be_true
772
-
773
- # Test that the index url is reported correctly
774
- ls.sitemap_index.index_url.should == 'http://example.com/sitemap.xml.gz'
775
- end
776
-
777
- it "should not write the index when only one sitemap is added (considered internal usage)" do
778
- ls.sitemap_index.add sitemap
779
- ls.sitemap_index.empty?.should be_false
780
- ls.send(:finalize_sitemap_index!)
781
- ls.sitemap_index.written?.should be_false
782
-
783
- # Test that the index url is reported correctly
784
- ls.sitemap_index.index_url.should == sitemap.location.url
785
- end
786
-
787
- it "should write the index when more than one sitemap is added (considered internal usage)" do
788
- ls.sitemap_index.add sitemap
789
- ls.sitemap_index.add sitemap.new
790
- ls.send(:finalize_sitemap_index!)
791
- ls.sitemap_index.written?.should be_true
792
-
793
- # Test that the index url is reported correctly
794
- ls.sitemap_index.index_url.should == ls.sitemap_index.location.url
795
- ls.sitemap_index.index_url.should == 'http://example.com/sitemap.xml.gz'
796
- end
797
-
798
- it "should write the index when it has more than one link" do
799
- ls.sitemap_index.add '/test1'
800
- ls.sitemap_index.add '/test2'
801
- ls.send(:finalize_sitemap_index!)
802
- ls.sitemap_index.written?.should be_true
803
-
804
- # Test that the index url is reported correctly
805
- ls.sitemap_index.index_url.should == 'http://example.com/sitemap.xml.gz'
806
- end
807
- end
808
- end
809
-
810
- describe "when sitemap empty" do
811
- before :each do
812
- ls.include_root = false
813
- end
814
-
815
- it "should not be written" do
816
- ls.sitemap.empty?.should be_true
817
- ls.expects(:add_to_index).never
818
- ls.send(:finalize_sitemap!)
819
- end
820
-
821
- it "should be written" do
822
- ls.sitemap.add '/test'
823
- ls.sitemap.empty?.should be_false
824
- ls.expects(:add_to_index).with(ls.sitemap)
825
- ls.send(:finalize_sitemap!)
826
- end
827
- end
828
-
829
- describe "compress" do
830
- it "should be true by default" do
831
- ls.compress.should be_true
832
- end
833
-
834
- it "should be set on the location objects" do
835
- ls.sitemap.location[:compress].should be_true
836
- ls.sitemap_index.location[:compress].should be_true
837
- end
838
-
839
- it "should be settable and gettable" do
840
- ls.compress = false
841
- ls.compress.should be_false
842
- ls.compress = :all_but_first
843
- ls.compress.should == :all_but_first
844
- end
845
-
846
- it "should update the location objects when set" do
847
- ls.compress = false
848
- ls.sitemap.location[:compress].should be_false
849
- ls.sitemap_index.location[:compress].should be_false
850
- end
851
-
852
- describe "in groups" do
853
- it "should inherit the current compress setting" do
854
- ls.compress = false
855
- ls.group.compress.should be_false
856
- end
857
-
858
- it "should set the compress value" do
859
- group = ls.group(:compress => false)
860
- group.compress.should be_false
861
- end
862
- end
863
- end
864
- end