midiator 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,45 +15,45 @@
15
15
  #
16
16
 
17
17
  class String
18
- ### NOTE: Stolen from ActiveSupport. They hold the copyright. Our
19
- ### modifications are making it a method on String and removing the
20
- ### lowerCamelCase option since we don't use it.
21
- ###
22
- ### +camelize+ converts strings to CamelCase.
23
- ###
24
- ### +camelize+ will also convert '/' to '::' which is useful for converting
25
- ### paths to namespaces.
26
- ###
27
- ### Examples
28
- ### "active_record".camelize #=> "ActiveRecord"
29
- ### "active_record/errors".camelize #=> "ActiveRecord::Errors"
30
- def camelize
31
- return self.gsub( /\/(.?)/ ) {
32
- "::" + $1.upcase
33
- }.
34
- gsub( /(^|_)(.)/ ) {
35
- $2.upcase
36
- }
37
- end
18
+ ### NOTE: Stolen from ActiveSupport. They hold the copyright. Our
19
+ ### modifications are making it a method on String and removing the
20
+ ### lowerCamelCase option since we don't use it.
21
+ ###
22
+ ### +camelize+ converts strings to CamelCase.
23
+ ###
24
+ ### +camelize+ will also convert '/' to '::' which is useful for converting
25
+ ### paths to namespaces.
26
+ ###
27
+ ### Examples
28
+ ### "active_record".camelize #=> "ActiveRecord"
29
+ ### "active_record/errors".camelize #=> "ActiveRecord::Errors"
30
+ def camelize
31
+ return self.gsub( /\/(.?)/ ) {
32
+ "::" + $1.upcase
33
+ }.
34
+ gsub( /(^|_)(.)/ ) {
35
+ $2.upcase
36
+ }
37
+ end
38
38
 
39
- ### NOTE: Stolen from ActiveSupport. They hold the copyright. The only
40
- ### modifications were to make it a String instance method instead of a
41
- ### function.
42
- ###
43
- ### The reverse of +camelize+. Makes an underscored form from the expression
44
- ### in the string.
45
- ###
46
- ### Changes '::' to '/' to convert namespaces to paths.
47
- ###
48
- ### Examples
49
- ### "ActiveRecord".underscore #=> "active_record"
50
- ### "ActiveRecord::Errors".underscore #=> active_record/errors
51
- def underscore
52
- return self.gsub( /::/, '/' ).
53
- gsub( /([A-Z]+)([A-Z][a-z])/, '\1_\2' ).
54
- gsub( /([a-z\d])([A-Z])/ , '\1_\2' ).
55
- tr( "-", "_" ).
56
- downcase
57
- end
39
+ ### NOTE: Stolen from ActiveSupport. They hold the copyright. The only
40
+ ### modifications were to make it a String instance method instead of a
41
+ ### function.
42
+ ###
43
+ ### The reverse of +camelize+. Makes an underscored form from the expression
44
+ ### in the string.
45
+ ###
46
+ ### Changes '::' to '/' to convert namespaces to paths.
47
+ ###
48
+ ### Examples
49
+ ### "ActiveRecord".underscore #=> "active_record"
50
+ ### "ActiveRecord::Errors".underscore #=> active_record/errors
51
+ def underscore
52
+ return self.gsub( /::/, '/' ).
53
+ gsub( /([A-Z]+)([A-Z][a-z])/, '\1_\2' ).
54
+ gsub( /([a-z\d])([A-Z])/ , '\1_\2' ).
55
+ tr( "-", "_" ).
56
+ downcase
57
+ end
58
58
 
59
59
  end
@@ -20,33 +20,33 @@ require 'rake/gempackagetask'
20
20
 
21
21
  ### Task: gem
22
22
  gemspec = Gem::Specification.new do |gem|
23
- gem.name = "midiator"
24
- gem.version = MIDIator::VERSION
23
+ gem.name = "midiator"
24
+ gem.version = MIDIator::VERSION
25
25
 
26
- gem.summary = "MIDIator - A a nice Ruby interface to your system's MIDI services."
27
- gem.description = "MIDIator provides an OS-agnostic way to send live MIDI messages to " +
28
- "your machine's MIDI playback system."
26
+ gem.summary = "MIDIator - A a nice Ruby interface to your system's MIDI services."
27
+ gem.description = "MIDIator provides an OS-agnostic way to send live MIDI messages to " +
28
+ "your machine's MIDI playback system."
29
29
 
30
- gem.authors = "Ben Bleything"
31
- gem.email = "ben@bleything.net"
32
- gem.homepage = "http://projects.bleything.net/projects/show/midiator"
30
+ gem.authors = "Ben Bleything"
31
+ gem.email = "ben@bleything.net"
32
+ gem.homepage = "http://projects.bleything.net/projects/show/midiator"
33
33
 
34
- gem.rubyforge_project = 'midiator'
34
+ gem.rubyforge_project = 'midiator'
35
35
 
36
- gem.has_rdoc = true
36
+ gem.has_rdoc = true
37
37
 
38
- gem.files = RELEASE_FILES.
39
- collect {|f| f.relative_path_from(BASE_DIR).to_s }
40
- gem.test_files = SPEC_FILES.
41
- collect {|f| f.relative_path_from(BASE_DIR).to_s }
38
+ gem.files = RELEASE_FILES.
39
+ collect {|f| f.relative_path_from(BASE_DIR).to_s }
40
+ gem.test_files = SPEC_FILES.
41
+ collect {|f| f.relative_path_from(BASE_DIR).to_s }
42
42
 
43
- gem.add_dependency 'Platform', [">= 0.4.0"]
43
+ gem.add_dependency 'Platform', [">= 0.4.0"]
44
44
  end
45
45
 
46
46
  Rake::GemPackageTask.new( gemspec ) do |task|
47
- task.gem_spec = gemspec
48
- task.need_tar = false
49
- task.need_tar_gz = true
50
- task.need_tar_bz2 = true
51
- task.need_zip = true
47
+ task.gem_spec = gemspec
48
+ task.need_tar = false
49
+ task.need_tar_gz = true
50
+ task.need_tar_bz2 = true
51
+ task.need_zip = true
52
52
  end
data/misc/rake/rdoc.rb CHANGED
@@ -15,31 +15,26 @@
15
15
 
16
16
  require 'rake/rdoctask'
17
17
 
18
- # uncomment for darkfish!
19
- # gem 'darkfish-rdoc'
20
- # require 'darkfish-rdoc'
21
-
22
18
  # uncomment for hanna!
23
- gem 'mislav-hanna'
24
- require 'hanna'
19
+ # gem 'mislav-hanna'
20
+ # require 'hanna'
25
21
 
26
22
  ### Task: rdoc
27
23
  Rake::RDocTask.new do |rdoc|
28
- rdoc.rdoc_dir = 'docs/rdoc'
29
- rdoc.title = "MIDIator - a nice Ruby interface to your system's MIDI services."
24
+ rdoc.rdoc_dir = 'docs/rdoc'
25
+ rdoc.title = "MIDIator - a nice Ruby interface to your system's MIDI services."
30
26
 
31
- rdoc.options += [
32
- '-w', '4',
33
- '-SHNa',
34
- '-i', BASE_DIR.to_s,
35
- # '-f', 'darkfish', # uncomment for darkfish!
36
- '-T', 'hanna', # uncomment for hanna!
37
- '-m', 'README',
38
- '-W', 'http://projects.bleything.net/repositories/changes/midiator/',
39
- ]
27
+ rdoc.options += [
28
+ '-w', '4',
29
+ '-SHNa',
30
+ '-i', BASE_DIR.to_s,
31
+ # '-T', 'hanna', # uncomment for hanna!
32
+ '-m', 'README',
33
+ '-W', 'http://projects.bleything.net/repositories/changes/midiator/',
34
+ ]
40
35
 
41
- rdoc.rdoc_files.include 'README'
42
- rdoc.rdoc_files.include 'LICENSE'
43
- rdoc.rdoc_files.include 'LICENSE.prp'
44
- rdoc.rdoc_files.include LIB_FILES.collect {|f| f.relative_path_from(BASE_DIR).to_s }
36
+ rdoc.rdoc_files.include 'README'
37
+ rdoc.rdoc_files.include 'LICENSE'
38
+ rdoc.rdoc_files.include 'LICENSE.prp'
39
+ rdoc.rdoc_files.include LIB_FILES.collect {|f| f.relative_path_from(BASE_DIR).to_s }
45
40
  end
data/misc/rake/testing.rb CHANGED
@@ -17,16 +17,16 @@ require 'spec/rake/spectask'
17
17
 
18
18
  desc "Run the RSpec suite"
19
19
  Spec::Rake::SpecTask.new( :spec ) do |r|
20
- r.libs = SPEC_FILES
21
- r.spec_opts = %w(--format specdoc --color)
20
+ r.libs = SPEC_FILES
21
+ r.spec_opts = %w(--format specdoc --color)
22
22
  end
23
23
 
24
24
  namespace :spec do
25
- ### Run the specifications and generate coverage information
26
- Spec::Rake::SpecTask.new( :coverage ) do |r|
27
- r.rcov = true
28
- r.rcov_dir = 'coverage'
29
- r.rcov_opts = %w( -x Library\/Ruby,^spec )
30
- r.libs = SPEC_FILES
31
- end
25
+ ### Run the specifications and generate coverage information
26
+ Spec::Rake::SpecTask.new( :coverage ) do |r|
27
+ r.rcov = true
28
+ r.rcov_dir = 'coverage'
29
+ r.rcov_opts = %w( -x Library\/Ruby,^spec )
30
+ r.libs = SPEC_FILES
31
+ end
32
32
  end
@@ -16,100 +16,100 @@
16
16
  require File.join( File.dirname(__FILE__), 'lib', 'spec_helper.rb' )
17
17
 
18
18
  describe MIDIator::DriverRegistry do
19
- before( :all ) do
20
- # alias MIDIator::Driver's inherited method out of the way and
21
- # redefine it as a no-op. This prevents MIDIator::Driver from trying
22
- # to auto-register subclasses.
23
- MIDIator::Driver.instance_eval {
24
- class << self
25
- alias_method :old_inherited, :inherited
26
- end
27
-
28
- def self::inherited( klass )
29
- # no-op
30
- end
31
- }
32
- end
33
-
34
- after( :all ) do
35
- # move MIDIator::Driver's inherited method back into place
36
- MIDIator::Driver.instance_eval {
37
- class << self
38
- alias_method :inherited, :old_inherited
39
- end
40
- }
41
- end
42
-
43
- before( :each ) do
44
- @registry = MIDIator::DriverRegistry.instance
45
-
46
- @driver_fixture = {
47
- :a => "is for apple",
48
- :b => "is for bunches of apples"
49
- }
50
- end
51
-
52
- after( :each ) do
53
- @registry.instance_variable_set( :@drivers, nil )
54
- end
55
-
56
- it "is a Singleton" do
57
- lambda { MIDIator::DriverRegistry.new }.should raise_error
58
- MIDIator::DriverRegistry.should respond_to( :instance )
59
- end
60
-
61
- it "knows how many drivers are registered" do
62
- @registry.instance_variable_set( :@drivers, @driver_fixture )
63
- @registry.size.should == @driver_fixture.size
64
- end
65
-
66
- it "can be dereferenced as though it was a hash" do
67
- @registry.instance_variable_set( :@drivers, @driver_fixture )
68
- @driver_fixture.keys.each do |key|
69
- @registry[ key ].should == @driver_fixture[ key ]
70
- end
71
- end
72
-
73
- it "aliases #register_driver to #register and #<<" do
74
- register_driver = @registry.method( :register_driver )
75
-
76
- @registry.method( :<< ).should == register_driver
77
- @registry.method( :register ).should == register_driver
78
- end
79
-
80
- it "keeps track of registered drivers by name" do
81
- Bees = Class.new( MIDIator::Driver )
82
- Sandwiches = Class.new( MIDIator::Driver )
83
- Guns = Class.new( MIDIator::Driver )
84
-
85
- @registry.register( :bees, Bees )
86
- @registry.register( :sandwiches, Sandwiches )
87
- @registry.register( :guns, Guns )
88
-
89
- @registry[ :bees ].should be( Bees )
90
- @registry[ :sandwiches ].should be( Sandwiches )
91
- @registry[ :guns ].should be( Guns )
92
- end
93
-
94
- it "prevents anything other than a MIDIator::Driver subclass from being registered" do
95
- lambda {
96
- @registry.register( :failboat, String )
97
- }.should raise_error( ArgumentError, "Attempted to register something that is not a MIDIator::Driver" )
98
-
99
- lambda {
100
- @registry.register( :great_success, Class.new( MIDIator::Driver ) )
101
- }.should_not raise_error
102
- end
103
-
104
- it "prevents a single driver from being registered multiple times" do
105
- klass = Class.new( MIDIator::Driver )
106
-
107
- lambda {
108
- @registry.register( :first_try, klass )
109
- }.should_not raise_error
110
-
111
- lambda {
112
- @registry.register( :second_try, klass )
113
- }.should raise_error( ArgumentError, "Already registered #{klass.to_s} as 'first_try'." )
114
- end
19
+ before( :all ) do
20
+ # alias MIDIator::Driver's inherited method out of the way and
21
+ # redefine it as a no-op. This prevents MIDIator::Driver from trying
22
+ # to auto-register subclasses.
23
+ MIDIator::Driver.instance_eval {
24
+ class << self
25
+ alias_method :old_inherited, :inherited
26
+ end
27
+
28
+ def self::inherited( klass )
29
+ # no-op
30
+ end
31
+ }
32
+ end
33
+
34
+ after( :all ) do
35
+ # move MIDIator::Driver's inherited method back into place
36
+ MIDIator::Driver.instance_eval {
37
+ class << self
38
+ alias_method :inherited, :old_inherited
39
+ end
40
+ }
41
+ end
42
+
43
+ before( :each ) do
44
+ @registry = MIDIator::DriverRegistry.instance
45
+
46
+ @driver_fixture = {
47
+ :a => "is for apple",
48
+ :b => "is for bunches of apples"
49
+ }
50
+ end
51
+
52
+ after( :each ) do
53
+ @registry.instance_variable_set( :@drivers, nil )
54
+ end
55
+
56
+ it "is a Singleton" do
57
+ lambda { MIDIator::DriverRegistry.new }.should raise_error
58
+ MIDIator::DriverRegistry.should respond_to( :instance )
59
+ end
60
+
61
+ it "knows how many drivers are registered" do
62
+ @registry.instance_variable_set( :@drivers, @driver_fixture )
63
+ @registry.size.should == @driver_fixture.size
64
+ end
65
+
66
+ it "can be dereferenced as though it was a hash" do
67
+ @registry.instance_variable_set( :@drivers, @driver_fixture )
68
+ @driver_fixture.keys.each do |key|
69
+ @registry[ key ].should == @driver_fixture[ key ]
70
+ end
71
+ end
72
+
73
+ it "aliases #register_driver to #register and #<<" do
74
+ register_driver = @registry.method( :register_driver )
75
+
76
+ @registry.method( :<< ).should == register_driver
77
+ @registry.method( :register ).should == register_driver
78
+ end
79
+
80
+ it "keeps track of registered drivers by name" do
81
+ Bees = Class.new( MIDIator::Driver )
82
+ Sandwiches = Class.new( MIDIator::Driver )
83
+ Guns = Class.new( MIDIator::Driver )
84
+
85
+ @registry.register( :bees, Bees )
86
+ @registry.register( :sandwiches, Sandwiches )
87
+ @registry.register( :guns, Guns )
88
+
89
+ @registry[ :bees ].should be( Bees )
90
+ @registry[ :sandwiches ].should be( Sandwiches )
91
+ @registry[ :guns ].should be( Guns )
92
+ end
93
+
94
+ it "prevents anything other than a MIDIator::Driver subclass from being registered" do
95
+ lambda {
96
+ @registry.register( :failboat, String )
97
+ }.should raise_error( ArgumentError, "Attempted to register something that is not a MIDIator::Driver" )
98
+
99
+ lambda {
100
+ @registry.register( :great_success, Class.new( MIDIator::Driver ) )
101
+ }.should_not raise_error
102
+ end
103
+
104
+ it "prevents a single driver from being registered multiple times" do
105
+ klass = Class.new( MIDIator::Driver )
106
+
107
+ lambda {
108
+ @registry.register( :first_try, klass )
109
+ }.should_not raise_error
110
+
111
+ lambda {
112
+ @registry.register( :second_try, klass )
113
+ }.should raise_error( ArgumentError, "Already registered #{klass.to_s} as 'first_try'." )
114
+ end
115
115
  end
data/spec/driver_spec.rb CHANGED
@@ -16,14 +16,14 @@
16
16
  require File.join( File.dirname(__FILE__), 'lib', 'spec_helper.rb' )
17
17
 
18
18
  describe MIDIator::Driver do
19
- it "automatically registers subclasses" do
20
- SomeCoolDriver = Class.new
21
- SomeCoolDriver.should_receive( :< ).with( MIDIator::Driver ).and_return( true )
19
+ it "automatically registers subclasses" do
20
+ SomeCoolDriver = Class.new
21
+ SomeCoolDriver.should_receive( :< ).with( MIDIator::Driver ).and_return( true )
22
22
 
23
- # call inherited directly since we can't set up expectations ahead of
24
- # time with Class.new( MIDIator::Driver )
25
- MIDIator::Driver.inherited( SomeCoolDriver )
23
+ # call inherited directly since we can't set up expectations ahead of
24
+ # time with Class.new( MIDIator::Driver )
25
+ MIDIator::Driver.inherited( SomeCoolDriver )
26
26
 
27
- MIDIator::DriverRegistry.instance[ "some_cool_driver" ].should be( SomeCoolDriver )
28
- end
27
+ MIDIator::DriverRegistry.instance[ "some_cool_driver" ].should be( SomeCoolDriver )
28
+ end
29
29
  end
@@ -20,121 +20,121 @@
20
20
  require File.join( File.dirname(__FILE__), 'lib', 'spec_helper.rb' )
21
21
 
22
22
  describe MIDIator::Interface do
23
- before( :each ) do
24
- @driver_name = 'i_like_bees'
23
+ before( :each ) do
24
+ @driver_name = 'i_like_bees'
25
25
 
26
- @interface = MIDIator::Interface.new
27
- @driver_class = mock( "driver class" )
28
- end
26
+ @interface = MIDIator::Interface.new
27
+ @driver_class = mock( "driver class" )
28
+ end
29
29
 
30
- describe "auto-detects the correct driver for your platform" do
31
- before( :all ) do
32
- # remember platform so we can reset it later
33
- @ruby_platform = Platform::IMPL
30
+ describe "auto-detects the correct driver for your platform" do
31
+ before( :all ) do
32
+ # remember platform so we can reset it later
33
+ @ruby_platform = Platform::IMPL
34
34
 
35
- # suppress warnings (http://www.ruby-forum.com/topic/127608)
36
- $-v = nil
37
- end
38
-
39
- after( :all ) do
40
- # reset platform to whatever is correct for our platform
41
- Platform::IMPL = @ruby_platform
42
-
43
- # restore warnings (http://www.ruby-forum.com/topic/127608)
44
- $-v = false
45
- end
46
-
47
- it "selects WinMM for Windows" do
48
- Platform::IMPL = :mswin
49
- @interface.should_receive( :use ).with( :winmm )
50
-
51
- @interface.autodetect_driver
52
- end
53
-
54
- it "selects CoreMIDI for OSX" do
55
- Platform::IMPL = :macosx
56
- @interface.should_receive( :use ).with( :core_midi )
57
-
58
- @interface.autodetect_driver
59
- end
60
-
61
- it "selects ALSA for Linux" do
62
- Platform::IMPL = :linux
63
- @interface.should_receive( :use ).with( :alsa )
64
-
65
- @interface.autodetect_driver
66
- end
67
- end
68
-
69
- describe "provides the #use method to load/specify a MIDI driver" do
70
- it "requires the driver's file from midiator/drivers" do
71
- path = "midiator/drivers/#{@driver_name}"
72
- @interface.should_receive( :require ).with( path )
73
-
74
- # stub out the rest of #use
75
- Object.should_receive( :module_eval ).and_return(
76
- mock( 'foo', :null_object => true )
77
- )
78
-
79
- @interface.use( @driver_name )
80
- end
81
-
82
- it "captures a LoadError and gives the user a slightly better message" do
83
- @interface.should_receive( :require ).and_raise( LoadError )
84
-
85
- lambda {
86
- @interface.use( @driver_name )
87
- }.should raise_error( LoadError, "Could not load driver '#{@driver_name.to_s}'.")
88
- end
89
-
90
- it "instantiates the driver's class" do
91
- @interface.stub!( :require )
92
-
93
- Object.should_receive( :module_eval ).with(
94
- "::MIDIator::Driver::ILikeBees"
95
- ).and_return( Class.new )
96
-
97
- @interface.use( @driver_name )
98
- end
99
-
100
- it "correctly spells MIDI if the driver name includes it" do
101
- @interface.stub!( :require )
102
-
103
- Object.should_receive( :module_eval ).with(
104
- "::MIDIator::Driver::SomeClassThatHasMIDIInItsName"
105
- ).and_return( Class.new )
106
-
107
- @interface.use( "some_class_that_has_midi_in_its_name" )
108
- end
109
-
110
- it "correctly spells ALSA when the ALSA driver is requested" do
111
- @interface.stub!( :require )
112
-
113
- Object.should_receive( :module_eval ).with(
114
- "::MIDIator::Driver::ALSA"
115
- ).and_return( Class.new )
116
-
117
- @interface.use( :alsa )
118
- end
119
-
120
- it "correctly spells WinMM when the WinMM driver is requested" do
121
- @interface.stub!( :require )
122
-
123
- Object.should_receive( :module_eval ).with(
124
- "::MIDIator::Driver::WinMM"
125
- ).and_return( Class.new )
126
-
127
- @interface.use( :winmm )
128
- end
129
-
130
- it "correctly spells DLSSynth when the DLSSynth driver is requested" do
131
- @interface.stub!( :require )
132
-
133
- Object.should_receive( :module_eval ).with(
134
- "::MIDIator::Driver::DLSSynth"
135
- ).and_return( Class.new )
136
-
137
- @interface.use( :dls_synth )
138
- end
139
- end
35
+ # suppress warnings (http://www.ruby-forum.com/topic/127608)
36
+ $-v = nil
37
+ end
38
+
39
+ after( :all ) do
40
+ # reset platform to whatever is correct for our platform
41
+ Platform::IMPL = @ruby_platform
42
+
43
+ # restore warnings (http://www.ruby-forum.com/topic/127608)
44
+ $-v = false
45
+ end
46
+
47
+ it "selects WinMM for Windows" do
48
+ Platform::IMPL = :mswin
49
+ @interface.should_receive( :use ).with( :winmm )
50
+
51
+ @interface.autodetect_driver
52
+ end
53
+
54
+ it "selects CoreMIDI for OSX" do
55
+ Platform::IMPL = :macosx
56
+ @interface.should_receive( :use ).with( :core_midi )
57
+
58
+ @interface.autodetect_driver
59
+ end
60
+
61
+ it "selects ALSA for Linux" do
62
+ Platform::IMPL = :linux
63
+ @interface.should_receive( :use ).with( :alsa )
64
+
65
+ @interface.autodetect_driver
66
+ end
67
+ end
68
+
69
+ describe "provides the #use method to load/specify a MIDI driver" do
70
+ it "requires the driver's file from midiator/drivers" do
71
+ path = "midiator/drivers/#{@driver_name}"
72
+ @interface.should_receive( :require ).with( path )
73
+
74
+ # stub out the rest of #use
75
+ Object.should_receive( :module_eval ).and_return(
76
+ mock( 'foo', :null_object => true )
77
+ )
78
+
79
+ @interface.use( @driver_name )
80
+ end
81
+
82
+ it "captures a LoadError and gives the user a slightly better message" do
83
+ @interface.should_receive( :require ).and_raise( LoadError )
84
+
85
+ lambda {
86
+ @interface.use( @driver_name )
87
+ }.should raise_error( LoadError, "Could not load driver '#{@driver_name.to_s}'.")
88
+ end
89
+
90
+ it "instantiates the driver's class" do
91
+ @interface.stub!( :require )
92
+
93
+ Object.should_receive( :module_eval ).with(
94
+ "::MIDIator::Driver::ILikeBees"
95
+ ).and_return( Class.new )
96
+
97
+ @interface.use( @driver_name )
98
+ end
99
+
100
+ it "correctly spells MIDI if the driver name includes it" do
101
+ @interface.stub!( :require )
102
+
103
+ Object.should_receive( :module_eval ).with(
104
+ "::MIDIator::Driver::SomeClassThatHasMIDIInItsName"
105
+ ).and_return( Class.new )
106
+
107
+ @interface.use( "some_class_that_has_midi_in_its_name" )
108
+ end
109
+
110
+ it "correctly spells ALSA when the ALSA driver is requested" do
111
+ @interface.stub!( :require )
112
+
113
+ Object.should_receive( :module_eval ).with(
114
+ "::MIDIator::Driver::ALSA"
115
+ ).and_return( Class.new )
116
+
117
+ @interface.use( :alsa )
118
+ end
119
+
120
+ it "correctly spells WinMM when the WinMM driver is requested" do
121
+ @interface.stub!( :require )
122
+
123
+ Object.should_receive( :module_eval ).with(
124
+ "::MIDIator::Driver::WinMM"
125
+ ).and_return( Class.new )
126
+
127
+ @interface.use( :winmm )
128
+ end
129
+
130
+ it "correctly spells DLSSynth when the DLSSynth driver is requested" do
131
+ @interface.stub!( :require )
132
+
133
+ Object.should_receive( :module_eval ).with(
134
+ "::MIDIator::Driver::DLSSynth"
135
+ ).and_return( Class.new )
136
+
137
+ @interface.use( :dls_synth )
138
+ end
139
+ end
140
140
  end