Class: TestTones

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/tests.rb

Instance Method Summary collapse

Instance Method Details

#test_settersObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/tests.rb', line 6

def test_setters
  t= Tone.new
  t.freq.start = (200)
  assert_equal(200, t.freq.start)
  t.freq.final = (20)
  assert_equal(20, t.freq.final)
  t.set_freq_final (30)
  assert_equal(30, t.freq.final)
  t.set_freq_final(20, false)
  assert_equal(-180, t.freq.final)
  assert_equal(-180, t.freq_final)
  assert_equal(20, t.freq_final(false))
  t.set_freq(250)
  assert_equal(-230, t.freq_final)
  t.set_freq(240)
  assert_equal(-220, t.freq_final)
  t.set_freq_final (0)
  assert_equal(0, t.freq.final)
  t.set_freq(10)
  assert_equal(0, t.freq_final)
end