Sha256: 6aac19c05ad1061a3cb95077a0b58ebd6ad1adae68e831d76a4e3a9167a3dd1c

Contents?: true

Size: 942 Bytes

Versions: 14

Compression:

Stored size: 942 Bytes

Contents

require_relative 'helper'


class TestProcessor < Test::Unit::TestCase

  B = Beeps

  def processor()
    B::Gain.new
  end

  def test_initialize()
    assert_raise(Beeps::BeepsError) {B::Processor.new}
  end

  def test_input()
    p = processor
    assert_nil p.input

    p.input = B::Oscillator.new
    assert_equal B::Oscillator, p.input.class

    p.input nil
    assert_nil p.input
  end

  def test_shift_right()
    osc   = B::Oscillator.new
    gain1 = B::Gain.new
    gain2 = B::Gain.new
    assert_equal gain2, (osc >> gain1 >> gain2)
    assert_equal nil,   osc.input
    assert_equal osc,   gain1.input
    assert_equal gain1, gain2.input
  end

  def test_shift_left()
    osc   = B::Oscillator.new
    gain1 = B::Gain.new
    gain2 = B::Gain.new
    assert_equal osc, (gain2 << gain1 << osc)
    assert_equal nil,   osc.input
    assert_equal osc,   gain1.input
    assert_equal gain1, gain2.input
  end

end# TestProcessor

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
beeps-0.3 test/test_processor.rb
beeps-0.2.1 test/test_processor.rb
beeps-0.2 test/test_processor.rb
beeps-0.1.46 test/test_processor.rb
beeps-0.1.45 test/test_processor.rb
beeps-0.1.44 test/test_processor.rb
beeps-0.1.43 test/test_processor.rb
beeps-0.1.42 test/test_processor.rb
beeps-0.1.41 test/test_processor.rb
beeps-0.1.40 test/test_processor.rb
beeps-0.1.39 test/test_processor.rb
beeps-0.1.38 test/test_processor.rb
beeps-0.1.37 test/test_processor.rb
beeps-0.1.36 test/test_processor.rb