Sha256: a67bbd42ceecdadf0018b495cce62bf84e6ae9f6bb82da39bdec2145c691cec8
Contents?: true
Size: 516 Bytes
Versions: 37
Compression:
Stored size: 516 Bytes
Contents
# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__)) + '/helper' class TestSafety < Test::Unit::TestCase class Testable include Tracksperanto::Safety attr_accessor :foo, :bar safe_reader :foo, :bar end def test_safe_reader_raises_with_no_ivar t = Testable.new assert_raise(RuntimeError) { t.foo } end def test_safe_reader_does_not_raise_with_value_assigned t = Testable.new t.foo = 123 assert_nothing_raised { assert_equal 123, t.foo } end end
Version data entries
37 entries across 37 versions & 1 rubygems