Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated filemidi to also take a filename
- Loading branch information
1 parent
aef7510
commit 9eb9cc5
Showing
2 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |