Sha256: 2c1b20afbb8c1b5e90c76c9e05859cdcdc3414bcf63e73225e1638e7d6acf1b0

Contents?: true

Size: 1.27 KB

Versions: 29

Compression:

Stored size: 1.27 KB

Contents

require 'test_helper'

module Vedeu

  describe EscapeChar do

    let(:described) { Vedeu::EscapeChar }
    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::EscapeChar '" \
        "\\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 # EscapeChar

end # Vedeu

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
vedeu-0.4.55 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.54 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.53 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.52 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.51 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.50 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.49 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.48 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.47 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.46 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.45 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.44 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.43 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.42 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.41 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.40 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.39 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.38 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.37 test/lib/vedeu/models/escape_char_test.rb
vedeu-0.4.36 test/lib/vedeu/models/escape_char_test.rb