mirror of
https://github.com/jimeh/time_ext.git
synced 2026-02-19 13:26:39 +00:00
added spec to check for core extention method
aliases
This commit is contained in:
19
spec/core_ext_spec.rb
Normal file
19
spec/core_ext_spec.rb
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
||||||
|
|
||||||
|
describe "Core Extensions" do
|
||||||
|
|
||||||
|
it "should alias Numeric class methods" do
|
||||||
|
number = 1
|
||||||
|
number.sec.should == number.second
|
||||||
|
number.min.should == number.minute
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should alias Time instance methods" do
|
||||||
|
time = Time.now
|
||||||
|
time.secs_ago(10).should == time.ago(10)
|
||||||
|
time.seconds_ago(10).should == time.ago(10)
|
||||||
|
time.secs_since(10).should == time.since(10)
|
||||||
|
time.seconds_since(10).should == time.since(10)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user