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