Sha256: a30a552fcfd71bda4b7a0c94fc95f1687c5bc265275621d9be72e62001a5f312

Contents?: true

Size: 1.36 KB

Versions: 6

Compression:

Stored size: 1.36 KB

Contents

require 'test_helper'

module Vedeu

  describe Escape do

    let(:described)  { Vedeu::Escape }
    let(:instance)   { described.new(attributes) }
    let(:attributes) {
      {
        value:    _value,
        position: position,
      }
    }
    let(:_value)     { "\e[?25h" }
    let(:position)   { [2, 6] }

    describe '#initialize' do
      it { instance.must_be_instance_of(described) }
      it { instance.instance_variable_get('@value').must_equal(_value) }
    end

    describe 'accessors' do
      it { instance.must_respond_to(:value) }
    end

    describe '#colour' do
      it { instance.colour.must_equal('') }
    end

    describe '#eql?' do
      let(:other) { instance }

      subject { instance.eql?(other) }

      it { subject.must_equal(true) }

      context 'when different to other' do
        let(:other) { described.new(value: 'b') }

        it { subject.must_equal(false) }
      end

      it { instance.must_respond_to(:==) }
    end

    describe '#position' do
      it { instance.position.must_be_instance_of(Vedeu::Position) }
    end

    describe '#style' do
      it { instance.style.must_equal('') }
    end

    describe '#value' do
      it { instance.value.must_be_instance_of(String) }
    end

    describe '#to_s' do
      subject { instance.to_s }

      it { instance.must_respond_to(:to_str) }
    end

  end # Escape

end # Vedeu

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.5.13 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.12 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.11 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.10 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.9 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.8 test/lib/vedeu/models/escape_test.rb