test/if_test.rb in representable-3.0.3 vs test/if_test.rb in representable-3.0.4
- old
+ new
@@ -1,9 +1,9 @@
require 'test_helper'
class IfTest < MiniTest::Spec
- let (:band_class) { Class.new do
+ let(:band_class) { Class.new do
include Representable::Hash
attr_accessor :fame
self
end }
@@ -16,17 +16,17 @@
it "ignores property when condition false" do
band_class.class_eval { property :fame, :if => lambda { |*| false } }
band = band_class.new
band.from_hash({"fame"=>"oh yes"})
- assert_equal nil, band.fame
+ assert_nil band.fame
end
it "ignores property when :exclude'ed even when condition is true" do
band_class.class_eval { property :fame, :if => lambda { |*| true } }
band = band_class.new
band.from_hash({"fame"=>"oh yes"}, {:exclude => [:fame]})
- assert_equal nil, band.fame
+ assert_nil band.fame
end
it "executes block in instance context" do
band_class.class_eval { property :fame, :if => lambda { |*| groupies }; attr_accessor :groupies }
band = band_class.new
\ No newline at end of file