Sha256: ba61ddf22b51b18260a2662b7791cc99ca88bd06938f0392ca5fb77ac4a719c1

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

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

describe InstrumentConfig do

  it "should assign the given name" do
    cfg = InstrumentConfig.new :plugin_name => "MyPluginName"
    cfg.plugin_name.should eq("MyPluginName")
  end
  
  it "should assign the given initial settings" do
    settings = {
      :volume => 0.5,
      :gain => 0.75,
    }
    cfg = InstrumentConfig.new :plugin_name => "MyPluginName", :initial_settings => settings
    cfg.initial_settings.should eq(settings)
  end

  it "should allow a String to be given as initial settings" do
    settings = "preset A"
    cfg = InstrumentConfig.new :plugin_name => "MyPluginName", :initial_settings => settings
    cfg.initial_settings.should eq(settings)
  end
  
  it "should allow an Array to be given as initial settings" do
    settings = ["preset A","preset B"]
    cfg = InstrumentConfig.new :plugin_name => "MyPluginName", :initial_settings => settings
    cfg.initial_settings.should eq(settings)
  end
  
  it "should assign each of the given setting changes" do
    setting_changes = {
      1.0 => {
        :volume => ValueChange.new(:value => 0.5),
        :gain => ValueChange.new(:value => 0.75),
      },
      4.0 => {
        :volume => ValueChange.new(:value => 0.1),
        :gain => ValueChange.new(:value => 0.1),
      }
    }
    
    cfg = InstrumentConfig.new :plugin_name => "MyPluginName", :setting_changes => setting_changes
    cfg.setting_changes.should eq(setting_changes)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
music-transcription-0.3.0 spec/instrument_config_spec.rb