test/int_test.rb in bindata-2.4.13 vs test/int_test.rb in bindata-2.4.14

- old
+ new

@@ -4,75 +4,75 @@ module AllIntegers def test_have_correct_num_bytes all_classes do |int_class| - int_class.new.num_bytes.must_equal @nbytes + _(int_class.new.num_bytes).must_equal @nbytes end end def test_have_a_sensible_value_of_zero all_classes do |int_class| - int_class.new.must_equal 0 + _(int_class.new).must_equal 0 end end def test_avoid_underflow all_classes do |int_class| subject = int_class.new subject.assign(min_value - 1) - subject.must_equal min_value + _(subject).must_equal min_value end end def test_avoid_overflow all_classes do |int_class| subject = int_class.new subject.assign(max_value + 1) - subject.must_equal max_value + _(subject).must_equal max_value end end def test_assign_values all_classes do |int_class| subject = int_class.new test_int = gen_test_int subject.assign(test_int) - subject.must_equal test_int + _(subject).must_equal test_int end end def test_assign_values_from_other_int_objects all_classes do |int_class| src = int_class.new src.assign(gen_test_int) subject = int_class.new subject.assign(src) - subject.must_equal src + _(subject).must_equal src end end def test_symmetrically_read_and_write_a_positive_number all_classes do |int_class| subject = int_class.new subject.assign(gen_test_int) - subject.value_read_from_written.must_equal subject + _(subject.value_read_from_written).must_equal subject end end def test_symmetrically_read_and_write_a_negative_number all_classes do |int_class| if @signed subject = int_class.new subject.assign(-gen_test_int) - subject.value_read_from_written.must_equal subject + _(subject.value_read_from_written).must_equal subject end end end def test_convert_a_positive_number_to_string @@ -80,11 +80,11 @@ val = gen_test_int subject = int_class.new subject.assign(val) - subject.to_binary_s.must_equal_binary int_to_binary_str(val) + _(subject.to_binary_s).must_equal_binary int_to_binary_str(val) end end def test_convert_a_negative_number_to_string all_classes do |int_class| @@ -92,11 +92,11 @@ val = -gen_test_int subject = int_class.new subject.assign(val) - subject.to_binary_s.must_equal_binary int_to_binary_str(val) + _(subject.to_binary_s).must_equal_binary int_to_binary_str(val) end end end def all_classes(&block) @@ -193,14 +193,14 @@ end end describe "Custom defined integers" do it "fail unless bits are a multiple of 8" do - lambda { BinData::Uint7le }.must_raise NameError + _ { BinData::Uint7le }.must_raise NameError - lambda { BinData::Uint7be }.must_raise NameError + _ { BinData::Uint7be }.must_raise NameError - lambda { BinData::Int7le }.must_raise NameError + _ { BinData::Int7le }.must_raise NameError - lambda { BinData::Int7be }.must_raise NameError + _ { BinData::Int7be }.must_raise NameError end end