Skip to content

Commit

Permalink
updated filemidi to also take a filename
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesbowkett committed May 5, 2009
1 parent aef7510 commit 9eb9cc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/midi/file_output/file_midi.rb
@@ -1,6 +1,8 @@
class FileMIDI
attr_accessor :clock
def initialize(clock)
@clock = clock
attr_accessor :clock, :filename
def initialize(options)
raise :hell unless options.is_a? Hash
@clock = options[:clock]
@filename = options[:filename]
end
end
6 changes: 4 additions & 2 deletions spec/midi_files_spec.rb
@@ -1,8 +1,10 @@
require 'lib/archaeopteryx'

describe FileMIDI do
it "requires a clock" do
FileMIDI.new(Clock.new(170)).should be_an_instance_of FileMIDI
it "requires options: a clock and a filename" do
FileMIDI.new(:clock => Clock.new(170),
:filename => "foo.mid").should be_an_instance_of FileMIDI
L{FileMIDI.new}.should raise_error
L{FileMIDI.new("asdf")}.should raise_error
end
end

0 comments on commit 9eb9cc5

Please sign in to comment.