Sha256: a7b07c6fc6da41e05f1b9fa5bbf8812e2cd49573d5ccfbc1331ac5598550ea9b

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 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 '#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

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.5.7 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.6 test/lib/vedeu/models/escape_test.rb