Sha256: 0b6c9dd08eab4e7155c75da58cc7912425f299ab124e7bb9fffb66abf53e2857

Contents?: true

Size: 691 Bytes

Versions: 5

Compression:

Stored size: 691 Bytes

Contents

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

describe Parsing::PitchNode do
  parser = Parsing::PitchParser.new
  
  {
    'C4' => C4,
    'Db2' => Db2,
    'C#2' => Db2,
    'Db2' => Db2,
    'F7' => F7,
    'B1' => B1,
  }.each do |str,tgt|
    res = parser.parse(str)
    context str do
      it 'should parse as PitchNode' do
        res.should be_a Parsing::PitchNode
      end
      
      describe '#to_pitch' do
        p = res.to_pitch
        it 'should produce a Pitch object' do
          p.should be_a Pitch
        end
        
        it 'should produce pitch matching input str' do
          p.should eq tgt
        end
      end
    end
  end  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
music-transcription-0.15.0 spec/parsing/pitch_node_spec.rb
music-transcription-0.14.0 spec/parsing/pitch_node_spec.rb
music-transcription-0.13.0 spec/parsing/pitch_node_spec.rb
music-transcription-0.11.0 spec/parsing/pitch_node_spec.rb
music-transcription-0.10.0 spec/parsing/pitch_node_spec.rb