spec/spec_helper.rb in music-transcription-0.7.1 vs spec/spec_helper.rb in music-transcription-0.7.2

- old
+ new

@@ -1,10 +1,11 @@ require 'rspec' require 'music-transcription' include Music::Transcription -include Music::Transcription::Pitches +include Pitches +include Meters class Samples SAMPLE_PART = Part.new( Dynamics::P, notes: [ @@ -12,6 +13,18 @@ Note::Quarter.new([ C2, D2 ]), Note::Whole.new([ C3, D3 ]) ], dynamic_changes: {1.0 => Change::Immediate.new(Dynamics::MP)} ) -end \ No newline at end of file +end + +RSpec::Matchers.define :be_valid do + match do |obj| + obj.valid? + end +end + +RSpec::Matchers.define :be_invalid do + match do |obj| + obj.invalid? + end +end