/
ress_spec.rb
70 lines (48 loc) · 1.61 KB
/
ress_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require_relative '../lib/ress'
describe Ress do
describe '.configure' do
it 'yields the default category collection' do
Ress.configure { |r| r.should be_a(Ress::Config) }
end
end
describe '.canonical_version' do
it 'returns a Ress::CanonicalVersion' do
Ress.canonical_version.should be_a(Ress::CanonicalVersion)
end
it 'can be altered through Ress.configure' do
Ress.configure { |r| r.set_canonical :subdomain => 'foo' }
Ress.canonical_version.matches?('foo').should be_true
end
end
describe '.alternate_versions' do
it 'can be altered through Ress.configure' do
expect {
Ress.configure { |r| r.add_alternate :name => 'foo' }
}.to change {
Ress.alternate_versions.length
}.by(1)
end
end
describe '.include_modernizr?' do
it 'defaults to false' do
Ress.include_modernizr?.should be_false
end
it 'can be altered through Ress.configure' do
Ress.configure { |r| r.include_modernizr = true }
Ress.include_modernizr?.should be_true
Ress.configure { |r| r.include_modernizr = false }
Ress.include_modernizr?.should be_false
end
end
describe '.replace_canonical_subdomain?' do
it 'defaults to false' do
Ress.replace_canonical_subdomain?.should be_false
end
it 'can be altered through Ress.configure' do
Ress.configure { |r| r.replace_canonical_subdomain = true }
Ress.replace_canonical_subdomain?.should be_true
Ress.configure { |r| r.replace_canonical_subdomain = false }
Ress.replace_canonical_subdomain?.should be_false
end
end
end