Sha256: 1f0732c34fcd6095e0c8d0daacfe49029de063368550ba83889e5c276ed5d93a

Contents?: true

Size: 627 Bytes

Versions: 3

Compression:

Stored size: 627 Bytes

Contents

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

describe Tempo do
  describe '#initialize' do
    it 'should assign given value' do
      Tempo.new(3).value.should eq(3)
    end
    
    context 'given negative value' do
      it 'should raise NonPositiveError' do
        expect { Tempo.new(-3) }.to raise_error(NonPositiveError)
      end
    end
  end
  
  [ :qnpm, :bpm, :npm, :nps ].each do |sym|
    describe "Tempo::#{sym}" do
      it "should print tempo value + '#{sym}'" do
        klass = Tempo.const_get(sym.upcase)
        klass.new(20).to_s.should eq("20#{sym}")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
music-transcription-0.21.0 spec/model/tempo_spec.rb
music-transcription-0.20.0 spec/model/tempo_spec.rb
music-transcription-0.19.0 spec/model/tempo_spec.rb