Sha256: c11544f210b400e38ee72318f2048b31c4aeedc3565656eee17d2eac429a3c08

Contents?: true

Size: 1.25 KB

Versions: 14

Compression:

Stored size: 1.25 KB

Contents

require 'test_helper'

module Vedeu

  describe Escape do

    let(:described) { Vedeu::Escape }
    let(:instance)  { described.new(_value) }
    let(:_value)    { "\e[?25h" }

    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 '#inspect' do
      it { instance.inspect.must_equal(
        "<Vedeu::Escape '" \
        "\\e[?25h"       \
        "'>"
      ) }
    end

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

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

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

      it { instance.must_respond_to(:to_s) }
      it { instance.must_respond_to(:to_str) }
    end

  end # Escape

end # Vedeu

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vedeu-0.5.3 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.2 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.1 test/lib/vedeu/models/escape_test.rb
vedeu-0.5.0 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.65 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.64 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.63 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.62 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.61 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.60 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.59 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.58 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.57 test/lib/vedeu/models/escape_test.rb
vedeu-0.4.56 test/lib/vedeu/models/escape_test.rb