Sha256: a3be0e03277b317c4bea5b3bf396b7184d023417b5398c825822dcc1b4e9959a

Contents?: true

Size: 626 Bytes

Versions: 7

Compression:

Stored size: 626 Bytes

Contents

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

describe Tempo do
  describe '#==' do
    context 'same bpm and beat duration' do
      it 'should return true' do
        [
          [120,nil],
          [120,0.25.to_r],
          [300,"3/8".to_r]
        ].each do |bpm,bd|
          Tempo.new(bpm,bd).should eq(Tempo.new(bpm,bd))
        end
      end
    end
    
    context 'different bpm or beat duration' do
      it 'should return false' do
        Tempo.new(120,nil).should_not eq(Tempo.new(120,"1/4".to_r))
        Tempo.new(200,2).should_not eq(Tempo.new(200,2.1))
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
music-transcription-0.17.1 spec/model/tempo_spec.rb
music-transcription-0.17.0 spec/model/tempo_spec.rb
music-transcription-0.16.0 spec/model/tempo_spec.rb
music-transcription-0.15.0 spec/model/tempo_spec.rb
music-transcription-0.14.0 spec/model/tempo_spec.rb
music-transcription-0.13.0 spec/model/tempo_spec.rb
music-transcription-0.11.0 spec/model/tempo_spec.rb