Sha256: ec5f537feb9cc62363fb05a1ed0377c8c52919501f33b2e5622685ec9d440911

Contents?: true

Size: 1003 Bytes

Versions: 5

Compression:

Stored size: 1003 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

describe Animoto::Song do
  
  describe "#to_hash" do
    before do
      @song = Animoto::Song.new 'http://website.com/song.mp3'
    end
    
    it "should have a 'source' key with the url" do
      @song.to_hash.should have_key('source')
      @song.to_hash['source'].should == @song.source
    end
    
    describe "if a start time was specified" do
      before do
        @song.start_time = 30.2
      end
      
      it "should have a 'start_time' key with the start time" do
        @song.to_hash.should have_key('start_time')
        @song.to_hash['start_time'].should == @song.start_time
      end
    end
    
    describe "if a duration was specified" do
      before do
        @song.duration = 300
      end
      
      it "should have a 'duration' key with the duration" do
        @song.to_hash.should have_key('duration')
        @song.to_hash['duration'].should == @song.duration
      end
    end    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
animoto-0.0.0.alpha6 ./spec/animoto/song_spec.rb
animoto-0.0.0.alpha5 ./spec/animoto/song_spec.rb
animoto-0.0.0.alpha4 ./spec/animoto/song_spec.rb
animoto-0.0.0.alpha3 ./spec/animoto/song_spec.rb
animoto-0.0.0.alpha2 ./spec/animoto/song_spec.rb