Skip to content

Commit 5ee0f05

Browse files
author
Michael Bleigh
committed
Merge pull request ruby-grape#157 from bobbytables/format-with-1.8
Change time creation to adhere to ruby 1.8.
2 parents ac00d2f + 434bab7 commit 5ee0f05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/grape/entity_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
subject.expose :birthday, :format_with => :timestamp
101101

102-
model = { :birthday => Time.new(2012, 2, 27) }
102+
model = { :birthday => Time.gm(2012, 2, 27) }
103103
subject.new(mock(model)).as_json[:birthday].should == '02/27/2012'
104104
end
105105
end
@@ -239,11 +239,11 @@
239239
let(:attributes){ {
240240
:name => 'Bob Bobson',
241241
:email => '[email protected]',
242-
:birthday => Time.new(2012, 2, 27),
242+
:birthday => Time.gm(2012, 2, 27),
243243
:fantasies => ['Unicorns', 'Double Rainbows', 'Nessy'],
244244
:friends => [
245-
mock(:name => "Friend 1", :email => '[email protected]', :fantasies => [], :birthday => Time.new(2012, 2, 27), :friends => []),
246-
mock(:name => "Friend 2", :email => '[email protected]', :fantasies => [], :birthday => Time.new(2012, 2, 27), :friends => [])
245+
mock(:name => "Friend 1", :email => '[email protected]', :fantasies => [], :birthday => Time.gm(2012, 2, 27), :friends => []),
246+
mock(:name => "Friend 2", :email => '[email protected]', :fantasies => [], :birthday => Time.gm(2012, 2, 27), :friends => [])
247247
]
248248
} }
249249
subject{ fresh_class.new(model) }

0 commit comments

Comments
 (0)