Sha256: f00053503855b98447802282e258266f2f3d808688547b511824553dd49b6387

Contents?: true

Size: 837 Bytes

Versions: 3

Compression:

Stored size: 837 Bytes

Contents

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

describe Link do
  context '#initialize' do
    it 'should assign the given pitch to :target_pitch' do
      Link.new(C2).target_pitch.should eq(C2)
    end
  end
    
  describe '#==' do
    it 'should return true if two links have the same target pitch' do
      Link.new(C2).should eq(Link.new(C2))
    end
    
    it 'should return false if two links do not have the same target pitch' do
      Link.new(C2).should_not eq(Link.new(F5))
    end
  end
  
  describe '#clone' do
    it 'should return a link with the same target pitch' do
      l = Link.new(C4)
      l.clone.should eq(l)
    end
  end
  
  describe '#to_yaml' do
    it 'should produce YAML that can be loaded' do
      l = Link::Slur.new(C5)
      YAML.load(l.to_yaml).should eq l
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
music-transcription-0.7.3 spec/link_spec.rb
music-transcription-0.7.2 spec/link_spec.rb
music-transcription-0.7.1 spec/link_spec.rb