Sha256: 8e0d224196706b52bf38c13744eb5992c7faf86bc8f5ccaeb53c0bdd2999fdb6

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

require 'test_helper'
require 'vedeu/models/stream'

module Vedeu
  describe Stream do
    let(:stream) {
      Stream.new({
        colour: {
          foreground: '#ff0000',
          background: '#000000'
        },
        text:  'Some text',
        style: 'normal'
      })
    }

    it 'has a colour attribute' do
      stream.colour.must_be_instance_of(Colour)
    end

    it 'has a text attribute' do
      stream.text.must_equal('Some text')
    end

    it 'has a style attribute' do
      stream.style.must_equal("\e[24m\e[21m\e[27m")
    end

    describe '#to_s' do
      it 'returns a String' do
        stream.to_s.must_equal(
          "\e[38;5;196m\e[48;5;16m" \
          "\e[24m\e[21m\e[27m" \
          "Some text"
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.1.3 test/lib/vedeu/models/stream_test.rb