Sha256: c472ffdc0641a7571a4b458d4918d3543861dd117e8904829b643df5d9eba602

Contents?: true

Size: 675 Bytes

Versions: 15

Compression:

Stored size: 675 Bytes

Contents

require 'minitest/autorun'

require_relative '../../lib/livetext'

class TestingLivetext < MiniTest::Test
  include Livetext::Standard

  # Only method here "really" belongs elsewhere?  FIXME

  def test_onoff
    refute onoff('off'), "Expected onoff('off') to be false"
    assert onoff('on'),  "Expected onoff('on') to be true"
    refute onoff('oFf'), "Expected onoff('oFf') to be false"
    assert onoff('oN'),  "Expected onoff('oN') to be true"
    assert onoff(nil),   "Expected onoff(nil) to be true"

    assert_raises(ExpectedOnOff, "Should raise ExpectedOnOff") { onoff("") }
    assert_raises(ExpectedOnOff, "Should raise ExpectedOnOff") { onoff(345) }
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
livetext-0.9.42 test/unit/standard.rb
livetext-0.9.41 test/unit/standard.rb
livetext-0.9.40 test/unit/standard.rb
livetext-0.9.39 test/unit/standard.rb
livetext-0.9.38 test/unit/standard.rb
livetext-0.9.37 test/unit/standard.rb
livetext-0.9.36 test/unit/standard.rb
livetext-0.9.35 test/unit/standard.rb
livetext-0.9.33 test/unit/standard.rb
livetext-0.9.32 test/unit/standard.rb
livetext-0.9.31 test/unit/standard.rb
livetext-0.9.30 test/unit/standard.rb
livetext-0.9.27 test/unit/standard.rb
livetext-0.9.26 test/unit/standard.rb
livetext-0.9.25 test/unit/standard.rb