Sha256: d910ad3711ab8ec6306dd5a30e023b72d2cebeeb93ecc6f7d33a87cdaf499dce
Contents?: true
Size: 1.05 KB
Versions: 16
Compression:
Stored size: 1.05 KB
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe ActiveSupport::Duration do before do @timecode = "5:27:25" @duration = ActiveSupport::Duration.parse(@timecode) end describe "#parse" do it "should instantiate from a delimited string" do @duration.should == 5.hours + 27.minutes + 25.seconds end end describe "#timecode" do it "should return a timecode string" do @duration.timecode.should == @timecode end end end describe Numeric do before do @timecode = "5:27:25" end describe "#to_timecode" do it "should return a timecode string" do 19645.to_timecode.should == @timecode end end end describe String do before do @timecode = "5:27:25" end describe "#to_seconds" do it "should return a duration of the right number of seconds" do @timecode.seconds.should == 19645 end end describe "#looks_like_duration?" do it "should return true for a correctly formatted duration" do @timecode.looks_like_duration?.should be_true end end end
Version data entries
16 entries across 16 versions & 1 rubygems