Sha256: 6243ea54fe87bbf856096f1ed813560640304c4a4e798456c2aa37f9b598a550

Contents?: true

Size: 370 Bytes

Versions: 7

Compression:

Stored size: 370 Bytes

Contents

require 'moosex'

class BuildExample 
	include MooseX

	has [:x, :y], {
		is: :rw,
		required: true,
	}
	def BUILD
		if self.x == self.y 
			raise "invalid: you should use x != y"
		end 
	end
end

describe "BuildExample" do
	it "should raise exception on build" do
		expect {
			BuildExample.new(x: 0, y: 0)
			}.to raise_error(/invalid: you should use x != y/)
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
moosex-0.0.16 spec/build_spec.rb
moosex-0.0.15 spec/build_spec.rb
moosex-0.0.14 spec/build_spec.rb
moosex-0.0.13 spec/build_spec.rb
moosex-0.0.12 spec/build_spec.rb
moosex-0.0.11 spec/build_spec.rb
moosex-0.0.10 spec/build_spec.rb