Sha256: 943008a6648f465c21bdef1616bb65e961a3d082633db182a9bdf3143c3fb009

Contents?: true

Size: 960 Bytes

Versions: 11

Compression:

Stored size: 960 Bytes

Contents

require 'test_helper'
require 'vedeu/models/attributes/line_collection'
require 'vedeu/models/interface'

module Vedeu
  describe LineCollection do
    let(:interface) { Interface.new(attributes) }

    describe '#coerce' do
      it 'returns an empty collection when there are no lines' do
        Interface.new({ lines: {} }).lines.must_equal([])
      end

      it 'contains a single Line object when the line is just a String' do
        Interface.new({ lines: 'some text' }).lines.size
          .must_equal(1)
      end

      it 'contains a single Line object when there is a single line' do
        Interface.new({ lines: { streams: { text: 'some text' } } })
          .lines.size.must_equal(1)
      end

      it 'contains multiple Line objects when there are multiple lines' do
        Interface.new({ lines: [
          { text: 'some text' },
          { text: 'some more text' }
        ] }).lines.size.must_equal(2)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vedeu-0.1.7 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.6 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.5 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.4 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.3 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.2 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.1 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.1.0 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.0.42 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.0.41 test/lib/vedeu/models/attributes/line_collection_test.rb
vedeu-0.0.40 test/lib/vedeu/models/attributes/line_collection_test.rb