spec/point_spec.rb in moosex-0.0.10 vs spec/point_spec.rb in moosex-0.0.11

- old
+ new

@@ -1,6 +1,7 @@ require 'moosex' +require 'moosex/types' class Point include MooseX has x: { @@ -86,17 +87,19 @@ it "for x, with type check" do p = Point.new expect { p.x = "lol" - }.to raise_error('isa check for "x" failed: is not instance of Integer!') + }.to raise_error(MooseX::Types::TypeCheckError, + "isa check for x=: Type violation: value 'lol' (String) is not an instance of [Type Integer]") end it "for x, with type check" do expect { Point.new(x: "lol") - }.to raise_error('isa check for "x" failed: is not instance of Integer!') + }.to raise_error(MooseX::Types::TypeCheckError, + "isa check for field x: Type violation: value 'lol' (String) is not an instance of [Type Integer]") end it "clear should clean attributes" do p = Point.new( x: 5, y: 4) p.clear @@ -170,16 +173,18 @@ it "for z, with type check" do p = Point3D.new expect { p.z = "lol" - }.to raise_error('isa check for "z" failed: is not instance of Integer!') + }.to raise_error(MooseX::Types::TypeCheckError, + "isa check for z=: Type violation: value 'lol' (String) is not an instance of [Type Integer]") end it "for z, with type check" do expect { Point3D.new(z: "lol") - }.to raise_error('isa check for "z" failed: is not instance of Integer!') + }.to raise_error(MooseX::Types::TypeCheckError, + "isa check for field z: Type violation: value 'lol' (String) is not an instance of [Type Integer]") end it "clear should clean attributes" do p = Point3D.new( x: 5, y: 4, z: 9) p.clear