test/unit/ns-options/namespace_test.rb in ns-options-0.4.0 vs test/unit/ns-options/namespace_test.rb in ns-options-0.4.1

- old
+ new

@@ -398,7 +398,35 @@ end end + class EqualityTests < HandlingTests + desc "when compared for equality" + setup do + @namespace.apply(@named_values) + end + + should "be equal to another namespace with the same named values" do + other_ns = NsOptions::Namespace.new('other_something') + other_ns.apply(@named_values) + + assert_equal other_ns, @namespace + end + + should "not be equal to another namespace with different values" do + other_ns = NsOptions::Namespace.new('other_something') + other_ns.apply({:other => 'data'}) + + assert_not_equal other_ns, @namespace + end + + should "not be equal to other things" do + assert_not_equal 1, @namespace + assert_not_equal @named_value, @namespace + end + + end + + end