Sha256: 6a2e853837130849532d9080e179e6a90e5de34b03168e323d551c55e3fd5a01

Contents?: true

Size: 1.53 KB

Versions: 34

Compression:

Stored size: 1.53 KB

Contents

require 'test_helper'

module Vedeu

  describe Cell do

    let(:described)  { Vedeu::Cell }
    let(:instance)   { described.new(attributes) }
    let(:attributes) {
      {
        colour: colour,
        style:  style,
        value:  _value,
        x:      x,
        y:      y,
      }
    }
    let(:colour) { Colour.new(background: '#000000') }
    let(:style)  {}
    let(:_value) {}
    let(:x)      {}
    let(:y)      {}

    describe '#initialize' do
      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

    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')) }

        it { subject.must_equal(false) }
      end
    end

  end # Cell

end # Vedeu

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
vedeu-0.5.8 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.7 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.6 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.5 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.4 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.3 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.2 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.1 test/lib/vedeu/models/cell_test.rb
vedeu-0.5.0 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.65 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.64 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.63 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.62 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.61 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.60 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.59 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.58 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.57 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.56 test/lib/vedeu/models/cell_test.rb
vedeu-0.4.55 test/lib/vedeu/models/cell_test.rb