test/lib/vedeu/models/cell_test.rb in vedeu-0.4.40 vs test/lib/vedeu/models/cell_test.rb in vedeu-0.4.41

- old
+ new

@@ -20,23 +20,31 @@ let(:_value) {} let(:x) {} let(:y) {} describe '#initialize' do - subject { instance } + it { instance.must_be_instance_of(described) } + it { instance.instance_variable_get('@colour').must_equal(colour) } + it { instance.instance_variable_get('@style').must_equal(style) } + it { instance.instance_variable_get('@value').must_equal(_value) } + it { instance.instance_variable_get('@x').must_equal(x) } + it { instance.instance_variable_get('@y').must_equal(y) } + end - it { subject.must_be_instance_of(described) } - it { subject.instance_variable_get('@colour').must_equal(colour) } - it { subject.instance_variable_get('@style').must_equal(style) } - it { subject.instance_variable_get('@value').must_equal(_value) } - it { subject.instance_variable_get('@x').must_equal(x) } - it { subject.instance_variable_get('@y').must_equal(y) } + describe 'accessors' do + it { instance.must_respond_to(:colour) } + it { instance.must_respond_to(:style) } + it { instance.must_respond_to(:value) } + it { instance.must_respond_to(:x) } + it { instance.must_respond_to(:y) } end describe '#eql?' do let(:other) { described.new(colour: Colour.new(background: '#000000')) } subject { instance.eql?(other) } + + it { subject.must_respond_to(:==) } it { subject.must_equal(true) } context 'when different to other' do let(:other) { described.new(colour: Colour.new(background: '#ff0000')) }