inversion 0.12.3 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -1
  3. data.tar.gz.sig +0 -0
  4. data/ChangeLog +305 -9
  5. data/Examples.rdoc +134 -0
  6. data/GettingStarted.rdoc +44 -0
  7. data/Guide.rdoc +47 -0
  8. data/History.rdoc +15 -0
  9. data/Manifest.txt +7 -2
  10. data/README.rdoc +9 -10
  11. data/Rakefile +23 -10
  12. data/Tags.rdoc +561 -0
  13. data/lib/inversion.rb +2 -2
  14. data/lib/inversion/renderstate.rb +46 -11
  15. data/lib/inversion/template.rb +85 -7
  16. data/lib/inversion/template/attrtag.rb +1 -1
  17. data/lib/inversion/template/begintag.rb +8 -8
  18. data/lib/inversion/template/fragmenttag.rb +60 -0
  19. data/lib/inversion/template/rescuetag.rb +1 -1
  20. data/spec/{lib/helpers.rb → helpers.rb} +7 -30
  21. data/spec/inversion/mixins_spec.rb +55 -65
  22. data/spec/inversion/monkeypatches_spec.rb +2 -12
  23. data/spec/inversion/parser_spec.rb +34 -44
  24. data/spec/inversion/renderstate_spec.rb +123 -69
  25. data/spec/inversion/sinatra_spec.rb +6 -19
  26. data/spec/inversion/template/attrtag_spec.rb +56 -76
  27. data/spec/inversion/template/begintag_spec.rb +24 -41
  28. data/spec/inversion/template/calltag_spec.rb +1 -18
  29. data/spec/inversion/template/codetag_spec.rb +6 -24
  30. data/spec/inversion/template/commenttag_spec.rb +9 -27
  31. data/spec/inversion/template/configtag_spec.rb +5 -16
  32. data/spec/inversion/template/containertag_spec.rb +4 -21
  33. data/spec/inversion/template/defaulttag_spec.rb +6 -23
  34. data/spec/inversion/template/elsetag_spec.rb +9 -26
  35. data/spec/inversion/template/elsiftag_spec.rb +7 -24
  36. data/spec/inversion/template/endtag_spec.rb +6 -23
  37. data/spec/inversion/template/escapetag_spec.rb +10 -25
  38. data/spec/inversion/template/fortag_spec.rb +20 -37
  39. data/spec/inversion/template/fragmenttag_spec.rb +40 -0
  40. data/spec/inversion/template/iftag_spec.rb +23 -40
  41. data/spec/inversion/template/importtag_spec.rb +8 -25
  42. data/spec/inversion/template/includetag_spec.rb +27 -42
  43. data/spec/inversion/template/node_spec.rb +6 -15
  44. data/spec/inversion/template/pptag_spec.rb +10 -23
  45. data/spec/inversion/template/publishtag_spec.rb +4 -21
  46. data/spec/inversion/template/rescuetag_spec.rb +12 -29
  47. data/spec/inversion/template/subscribetag_spec.rb +8 -25
  48. data/spec/inversion/template/tag_spec.rb +24 -37
  49. data/spec/inversion/template/textnode_spec.rb +8 -24
  50. data/spec/inversion/template/timedeltatag_spec.rb +31 -43
  51. data/spec/inversion/template/unlesstag_spec.rb +7 -24
  52. data/spec/inversion/template/uriencodetag_spec.rb +6 -23
  53. data/spec/inversion/template/yieldtag_spec.rb +3 -20
  54. data/spec/inversion/template_spec.rb +155 -108
  55. data/spec/inversion/tilt_spec.rb +7 -16
  56. data/spec/inversion_spec.rb +7 -22
  57. metadata +63 -40
  58. metadata.gz.sig +0 -0
  59. data/spec/lib/constants.rb +0 -9
@@ -1,36 +1,19 @@
1
1
  #!/usr/bin/env rspec -cfd -b
2
2
  # vim: set noet nosta sw=4 ts=4 :
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname( __FILE__ ).dirname.parent.parent.parent
7
- libdir = basedir + 'lib'
4
+ require_relative '../../helpers'
8
5
 
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
12
-
13
- require 'rspec'
14
- require 'spec/lib/helpers'
15
6
  require 'inversion/template'
16
7
  require 'inversion/template/textnode'
17
8
  require 'inversion/template/subscribetag'
18
9
 
19
10
  describe Inversion::Template::SubscribeTag do
20
11
 
21
- before( :all ) do
22
- setup_logging( :fatal )
23
- end
24
-
25
- after( :all ) do
26
- reset_logging()
27
- end
28
-
29
12
 
30
13
  it "raises a parse error if the key isn't a simple attribute" do
31
14
  expect {
32
15
  Inversion::Template::SubscribeTag.new( 'a.non-identifier' )
33
- }.to raise_exception( Inversion::ParseError, /malformed subscribe/i )
16
+ }.to raise_error( Inversion::ParseError, /malformed subscribe/i )
34
17
  end
35
18
 
36
19
  it "renders the nodes published by an immediate subtemplate with the same key" do
@@ -39,7 +22,7 @@ describe Inversion::Template::SubscribeTag do
39
22
 
40
23
  template.subtemplate = subtemplate
41
24
 
42
- template.render.should == '--a style--(subtemplate)'
25
+ expect( template.render ).to eq( '--a style--(subtemplate)' )
43
26
  end
44
27
 
45
28
  it "renders nodes published by an immediate subtemplate that's rendered before it" do
@@ -48,7 +31,7 @@ describe Inversion::Template::SubscribeTag do
48
31
 
49
32
  template.subtemplate = subtemplate
50
33
 
51
- template.render.should == '--(subtemplate)--a style'
34
+ expect( template.render ).to eq( '--(subtemplate)--a style' )
52
35
  end
53
36
 
54
37
  it "doesn't render anything if there are no publications with its key" do
@@ -57,12 +40,12 @@ describe Inversion::Template::SubscribeTag do
57
40
 
58
41
  template.subtemplate = subtemplate
59
42
 
60
- template.render.should == '----(subtemplate)'
43
+ expect( template.render ).to eq( '----(subtemplate)' )
61
44
  end
62
45
 
63
46
  it "renders a default value if one is supplied" do
64
47
  template = Inversion::Template.new( "<?subscribe not_here || default value! ?>" )
65
- template.render.should == "default value!"
48
+ expect( template.render ).to eq( "default value!" )
66
49
  end
67
50
 
68
51
  it "doesn't retain published nodes across renders" do
@@ -71,8 +54,8 @@ describe Inversion::Template::SubscribeTag do
71
54
 
72
55
  template.subtemplate = subtemplate
73
56
 
74
- template.render.should == '--a style--(subtemplate)'
75
- template.render.should == '--a style--(subtemplate)'
57
+ expect( template.render ).to eq( '--a style--(subtemplate)' )
58
+ expect( template.render ).to eq( '--a style--(subtemplate)' )
76
59
  end
77
60
 
78
61
  end
@@ -1,23 +1,13 @@
1
1
  #!/usr/bin/env rspec -cfd -b
2
2
  # vim: set noet nosta sw=4 ts=4 :
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname( __FILE__ ).dirname.parent.parent.parent
7
- libdir = basedir + 'lib'
4
+ require_relative '../../helpers'
8
5
 
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
12
-
13
- require 'rspec'
14
- require 'spec/lib/helpers'
15
6
  require 'inversion/template/tag'
16
7
 
17
8
  describe Inversion::Template::Tag do
18
9
 
19
10
  before( :all ) do
20
- setup_logging( :fatal )
21
11
  @real_derivatives = Inversion::Template::Tag.derivatives.dup
22
12
  @real_types = Inversion::Template::Tag.types.dup
23
13
  end
@@ -30,46 +20,43 @@ describe Inversion::Template::Tag do
30
20
  after( :all ) do
31
21
  Inversion::Template::Tag.instance_variable_set( :@derivatives, @real_derivatives )
32
22
  Inversion::Template::Tag.instance_variable_set( :@types, @real_types )
33
- reset_logging()
34
23
  end
35
24
 
36
25
 
37
26
  it "loads pluggable types via Rubygems" do
38
27
  pluginfile = '/usr/lib/ruby/gems/1.8/gems/inversion-extra-1.0.8/lib/inversion/template/zebratag.rb'
39
- Gem.stub( :find_files ).
28
+ expect( Gem ).to receive( :find_files ).
40
29
  with( Inversion::Template::Tag::TAG_PLUGIN_PATTERN ).
41
30
  and_return([ pluginfile ])
42
- Inversion::Template::Tag.should_receive( :require ).
43
- with( 'inversion/template/zebratag' ).
44
- and_return {
45
- Class.new( Inversion::Template::Tag ) {
46
- def self::name; "ZebraTag"; end
47
- }
48
- }
31
+ expect( Inversion::Template::Tag ).to receive( :require ) do |filename|
32
+ expect( filename ).to eq( 'inversion/template/zebratag' )
33
+ Class.new( Inversion::Template::Tag ) do
34
+ def self::name; "ZebraTag"; end
35
+ end
36
+ end
49
37
  result = Inversion::Template::Tag.load_all
50
- result.should be_a( Hash )
51
- result.should have( 1 ).member
52
- result.should have_key( :zebra )
53
- result[:zebra].should be_a( Class )
54
- result[:zebra].should < Inversion::Template::Tag
38
+ expect( result ).to be_a( Hash )
39
+ expect( result.size ).to eq( 1 )
40
+ expect( result ).to have_key( :zebra )
41
+ expect( result[:zebra] ).to be_a( Class )
42
+ expect( result[:zebra] ).to be < Inversion::Template::Tag
55
43
  end
56
44
 
57
45
  it "doesn't include abstract tag types in its loading mechanism" do
58
46
  pluginfile = '/usr/lib/ruby/gems/1.8/gems/inversion-extra-1.0.8/lib/inversion/template/zebratag.rb'
59
- Gem.stub( :find_files ).
47
+ expect( Gem ).to receive( :find_files ).
60
48
  with( Inversion::Template::Tag::TAG_PLUGIN_PATTERN ).
61
49
  and_return([ pluginfile ])
62
- Inversion::Template::Tag.should_receive( :require ).
63
- with( 'inversion/template/zebratag' ).
64
- and_return {
65
- Class.new( Inversion::Template::Tag ) {
66
- include Inversion::AbstractClass
67
- def self::name; "ZebraTag"; end
68
- }
69
- }
50
+ expect( Inversion::Template::Tag ).to receive( :require ) do |filename|
51
+ expect( filename ).to eq( 'inversion/template/zebratag' )
52
+ Class.new( Inversion::Template::Tag ) do
53
+ include Inversion::AbstractClass
54
+ def self::name; "ZebraTag"; end
55
+ end
56
+ end
70
57
  result = Inversion::Template::Tag.load_all
71
- result.should be_a( Hash )
72
- result.should == {}
58
+ expect( result ).to be_a( Hash )
59
+ expect( result ).to eq( {} )
73
60
  end
74
61
 
75
62
 
@@ -90,7 +77,7 @@ describe Inversion::Template::Tag do
90
77
 
91
78
 
92
79
  it "can render itself as a comment for template debugging" do
93
- @tag.as_comment_body.should == %{Concrete "the body" at line ??, column ??}
80
+ expect( @tag.as_comment_body ).to eq( %{Concrete "the body" at line ??, column ??} )
94
81
  end
95
82
 
96
83
  end
@@ -1,41 +1,24 @@
1
1
  #!/usr/bin/env rspec -cfd -b
2
2
  # vim: set noet nosta sw=4 ts=4 :
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname( __FILE__ ).dirname.parent.parent.parent
7
- libdir = basedir + 'lib'
4
+ require_relative '../../helpers'
8
5
 
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
12
-
13
- require 'rspec'
14
- require 'spec/lib/helpers'
15
6
  require 'inversion/template/textnode'
16
7
 
17
8
  describe Inversion::Template::TextNode do
18
9
 
19
- before( :all ) do
20
- setup_logging( :fatal )
21
- end
22
-
23
10
  before( :each ) do
24
11
  @state = Inversion::RenderState.new
25
12
  @node = Inversion::Template::TextNode.new( "unto thee" )
26
13
  end
27
14
 
28
- after( :all ) do
29
- reset_logging()
30
- end
31
-
32
15
 
33
16
  it "renders itself unchanged" do
34
- @node.render( @state ).should == "unto thee"
17
+ expect( @node.render( @state ) ).to eq( "unto thee" )
35
18
  end
36
19
 
37
20
  it "renders a brief description when rendered as a comment" do
38
- @node.as_comment_body.should == %{Text (9 bytes): "unto thee"}
21
+ expect( @node.as_comment_body ).to eq( %{Text (9 bytes): "unto thee"} )
39
22
  end
40
23
 
41
24
 
@@ -47,12 +30,12 @@ describe Inversion::Template::TextNode do
47
30
 
48
31
  it "strips the leading newline if :strip_tag_lines is set" do
49
32
  @state.options[:strip_tag_lines] = true
50
- @node.render( @state ).should == "\tSome stuff\nAnd some other stuff.\n "
33
+ expect( @node.render( @state ) ).to eq( "\tSome stuff\nAnd some other stuff.\n " )
51
34
  end
52
35
 
53
36
  it "renders as-is if :strip_tag_lines is not set" do
54
37
  @state.options[:strip_tag_lines] = false
55
- @node.render( @state ).should == @text
38
+ expect( @node.render( @state ) ).to eq( @text )
56
39
  end
57
40
 
58
41
  end
@@ -76,8 +59,9 @@ describe Inversion::Template::TextNode do
76
59
  expected_content = LONGER_CONTENT[0,40].dump
77
60
  expected_content[-1,0] = '...'
78
61
 
79
- @node.as_comment_body.should ==
80
- %Q{Text (488 bytes): "\\t\\t<p>Lorem ipsum dolor sit amet, consect..."}
62
+ expect(
63
+ @node.as_comment_body
64
+ ).to eq( %Q{Text (488 bytes): "\\t\\t<p>Lorem ipsum dolor sit amet, consect..."} )
81
65
  end
82
66
 
83
67
  end
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env rspec -cfd -b
2
2
  # vim: set noet nosta sw=4 ts=4 :
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname( __FILE__ ).dirname.parent.parent.parent
7
- libdir = basedir + 'lib'
4
+ require_relative '../../helpers'
8
5
 
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
12
-
13
- require 'rspec'
14
- require 'spec/lib/helpers'
15
6
  require 'inversion/template/timedeltatag'
16
7
 
17
8
  describe Inversion::Template::TimeDeltaTag do
@@ -32,8 +23,6 @@ describe Inversion::Template::TimeDeltaTag do
32
23
  ENV['TZ'] = 'US/Pacific'
33
24
  ENV['TZ'] = 'PST8PDT' if Time.now.utc_offset.zero?
34
25
 
35
- setup_logging( :fatal )
36
-
37
26
  @past = "Fri Aug 20 08:21:35.1876455 -0700 2010"
38
27
  @pasttime = Time.parse( @past )
39
28
  @pastsecs = @pasttime.to_i
@@ -49,63 +38,62 @@ describe Inversion::Template::TimeDeltaTag do
49
38
 
50
39
  before( :each ) do
51
40
  @tag = Inversion::Template::TimeDeltaTag.new( "foo" )
52
- Time.stub( :now ).and_return( @now )
41
+ allow( Time ).to receive( :now ).and_return( @now )
53
42
  end
54
43
 
55
44
  after( :all ) do
56
- reset_logging()
57
45
  ENV['TZ'] = @real_tz
58
46
  end
59
47
 
60
48
 
61
49
  it "renders the attribute as an approximate interval of time if it's a future Time object" do
62
50
  renderstate = Inversion::RenderState.new( :foo => @futuretime )
63
- @tag.render( renderstate ).should == "about a day from now"
51
+ expect( @tag.render( renderstate ) ).to eq( "about a day from now" )
64
52
  end
65
53
 
66
54
  it "renders the attribute as an approximate interval of time if it's a past Time object" do
67
55
  renderstate = Inversion::RenderState.new( :foo => @pasttime )
68
- @tag.render( renderstate ).should == "about a day ago"
56
+ expect( @tag.render( renderstate ) ).to eq( "about a day ago" )
69
57
  end
70
58
 
71
59
  it "renders the attribute as an approximate interval of time if it's a future Date object" do
72
60
  renderstate = Inversion::RenderState.new( :foo => @futuredate )
73
- @tag.render( renderstate ).should == "16 hours from now"
61
+ expect( @tag.render( renderstate ) ).to eq( "16 hours from now" )
74
62
  end
75
63
 
76
64
  it "renders the attribute as an approximate interval of time if it's a past Date object" do
77
65
  renderstate = Inversion::RenderState.new( :foo => @pastdate )
78
- @tag.render( renderstate ).should == "2 days ago"
66
+ expect( @tag.render( renderstate ) ).to eq( "2 days ago" )
79
67
  end
80
68
 
81
69
  it "renders the attribute as an approximate interval of time if it's a future DateTime object" do
82
70
  renderstate = Inversion::RenderState.new( :foo => @futuredatetime )
83
- @tag.render( renderstate ).should == "about a day from now"
71
+ expect( @tag.render( renderstate ) ).to eq( "about a day from now" )
84
72
  end
85
73
 
86
74
  it "renders the attribute as an approximate interval of time if it's a past DateTime object" do
87
75
  renderstate = Inversion::RenderState.new( :foo => @pastdatetime )
88
- @tag.render( renderstate ).should == "about a day ago"
76
+ expect( @tag.render( renderstate ) ).to eq( "about a day ago" )
89
77
  end
90
78
 
91
79
  it "renders the attribute as an approximate interval of time if it's a future String object" do
92
80
  renderstate = Inversion::RenderState.new( :foo => @future )
93
- @tag.render( renderstate ).should == "about a day from now"
81
+ expect( @tag.render( renderstate ) ).to eq( "about a day from now" )
94
82
  end
95
83
 
96
84
  it "renders the attribute as an approximate interval of time if it's a past String object" do
97
85
  renderstate = Inversion::RenderState.new( :foo => @past )
98
- @tag.render( renderstate ).should == "about a day ago"
86
+ expect( @tag.render( renderstate ) ).to eq( "about a day ago" )
99
87
  end
100
88
 
101
89
  it "renders the attribute as an approximate interval of time if it's a future epoch Numeric" do
102
90
  renderstate = Inversion::RenderState.new( :foo => @futuresecs )
103
- @tag.render( renderstate ).should == "about a day from now"
91
+ expect( @tag.render( renderstate ) ).to eq( "about a day from now" )
104
92
  end
105
93
 
106
94
  it "renders the attribute as an approximate interval of time if it's a past epoch Numeric" do
107
95
  renderstate = Inversion::RenderState.new( :foo => @pastsecs )
108
- @tag.render( renderstate ).should == "about a day ago"
96
+ expect( @tag.render( renderstate ) ).to eq( "about a day ago" )
109
97
  end
110
98
 
111
99
 
@@ -117,97 +105,97 @@ describe Inversion::Template::TimeDeltaTag do
117
105
 
118
106
  it "renders a period of a minute or less as 'less than a minute'" do
119
107
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 44 )
120
- @tag.render( renderstate ).should == "less than a minute from now"
108
+ expect( @tag.render( renderstate ) ).to eq( "less than a minute from now" )
121
109
  end
122
110
 
123
111
  it "renders a period of 58 seconds as 'a minute'" do
124
112
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 58 )
125
- @tag.render( renderstate ).should == "a minute from now"
113
+ expect( @tag.render( renderstate ) ).to eq( "a minute from now" )
126
114
  end
127
115
 
128
116
  it "renders a period of 60 seconds as 'a minute'" do
129
117
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 60 )
130
- @tag.render( renderstate ).should == "a minute from now"
118
+ expect( @tag.render( renderstate ) ).to eq( "a minute from now" )
131
119
  end
132
120
 
133
121
  it "renders a period of 68 seconds as 'a minute'" do
134
122
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 68 )
135
- @tag.render( renderstate ).should == "a minute from now"
123
+ expect( @tag.render( renderstate ) ).to eq( "a minute from now" )
136
124
  end
137
125
 
138
126
  it "renders a period of 93 seconds as '2 minutes'" do
139
127
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 93 )
140
- @tag.render( renderstate ).should == "2 minutes from now"
128
+ expect( @tag.render( renderstate ) ).to eq( "2 minutes from now" )
141
129
  end
142
130
 
143
131
  it "renders a period of 30 minutes as '30 minutes'" do
144
132
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 30 * MINUTES )
145
- @tag.render( renderstate ).should == "30 minutes from now"
133
+ expect( @tag.render( renderstate ) ).to eq( "30 minutes from now" )
146
134
  end
147
135
 
148
136
  it "renders a period of 58 minutes as 'about an hour'" do
149
137
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 58 * MINUTES )
150
- @tag.render( renderstate ).should == "about an hour from now"
138
+ expect( @tag.render( renderstate ) ).to eq( "about an hour from now" )
151
139
  end
152
140
 
153
141
  it "renders a period of 89 minutes as 'about an hour'" do
154
142
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 89 * MINUTES )
155
- @tag.render( renderstate ).should == "about an hour from now"
143
+ expect( @tag.render( renderstate ) ).to eq( "about an hour from now" )
156
144
  end
157
145
 
158
146
  it "renders a period of 95 minutes as '2 hours'" do
159
147
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 95 * MINUTES )
160
- @tag.render( renderstate ).should == "2 hours from now"
148
+ expect( @tag.render( renderstate ) ).to eq( "2 hours from now" )
161
149
  end
162
150
 
163
151
  it "renders a period of 17 hours as '17 hours'" do
164
152
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 17 * HOURS )
165
- @tag.render( renderstate ).should == "17 hours from now"
153
+ expect( @tag.render( renderstate ) ).to eq( "17 hours from now" )
166
154
  end
167
155
 
168
156
  it "renders a period of 20 hours as 'about a day'" do
169
157
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 20 * HOURS )
170
- @tag.render( renderstate ).should == "about a day from now"
158
+ expect( @tag.render( renderstate ) ).to eq( "about a day from now" )
171
159
  end
172
160
 
173
161
  it "renders a period of 6 days as '6 days'" do
174
162
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 6 * DAYS )
175
- @tag.render( renderstate ).should == "6 days from now"
163
+ expect( @tag.render( renderstate ) ).to eq( "6 days from now" )
176
164
  end
177
165
 
178
166
  it "renders a period of 11 days as 'about a week'" do
179
167
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 11 * DAYS )
180
- @tag.render( renderstate ).should == "about a week from now"
168
+ expect( @tag.render( renderstate ) ).to eq( "about a week from now" )
181
169
  end
182
170
 
183
171
  it "renders a period of 18 days as '3 weeks'" do
184
172
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 18 * DAYS )
185
- @tag.render( renderstate ).should == "3 weeks from now"
173
+ expect( @tag.render( renderstate ) ).to eq( "3 weeks from now" )
186
174
  end
187
175
 
188
176
  it "renders a period of 10 weeks as '10 weeks'" do
189
177
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 10 * WEEKS )
190
- @tag.render( renderstate ).should == "10 weeks from now"
178
+ expect( @tag.render( renderstate ) ).to eq( "10 weeks from now" )
191
179
  end
192
180
 
193
181
  it "renders a period of 4 months as '4 months'" do
194
182
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 4 * MONTHS )
195
- @tag.render( renderstate ).should == "4 months from now"
183
+ expect( @tag.render( renderstate ) ).to eq( "4 months from now" )
196
184
  end
197
185
 
198
186
  it "renders a period of 14 months as '14 months'" do
199
187
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 14 * MONTHS )
200
- @tag.render( renderstate ).should == "14 months from now"
188
+ expect( @tag.render( renderstate ) ).to eq( "14 months from now" )
201
189
  end
202
190
 
203
191
  it "renders a period of 20 months as '2 years'" do
204
192
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 20 * MONTHS )
205
- @tag.render( renderstate ).should == "2 years from now"
193
+ expect( @tag.render( renderstate ) ).to eq( "2 years from now" )
206
194
  end
207
195
 
208
196
  it "renders a period of 120 years as '120 years'" do
209
197
  renderstate = Inversion::RenderState.new( :foo => @now_epoch + 120 * YEARS )
210
- @tag.render( renderstate ).should == "120 years from now"
198
+ expect( @tag.render( renderstate ) ).to eq( "120 years from now" )
211
199
  end
212
200
 
213
201
  end