Sha256: 38fb43ea145358b621394a651f5d1eb4ddb7d8319814d72013d4d2f08b8ecdae

Contents?: true

Size: 848 Bytes

Versions: 8

Compression:

Stored size: 848 Bytes

Contents

# encoding: UTF-8

shared_examples 'a yaml stream' do
  it 'handles a simple array' do
    check_roundtrip(['abc'])
  end

  it 'handles a simple object' do
    check_roundtrip({ 'foo' => 'bar' })
  end

  it 'handles one level of array nesting' do
    check_roundtrip([['def'],'abc'])
    check_roundtrip(['abc',['def']])
  end

  it 'handles one level of object nesting' do
    check_roundtrip({ 'foo' => { 'bar' => 'baz' } })
  end

  it 'handles one level of mixed nesting' do
    check_roundtrip({ 'foo' => ['bar', 'baz'] })
    check_roundtrip([{ 'foo' => 'bar' }])
  end

  it 'handles multiple levels of mixed nesting' do
    check_roundtrip({'foo' => ['bar', { 'baz' => 'moo', 'gaz' => ['doo'] }, 'kal'], 'jim' => ['jill', ['john']] })
    check_roundtrip(['foo', { 'bar' => 'baz', 'moo' => ['gaz', ['jim', ['jill']], 'jam'] }])
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yaml-write-stream-2.0.2 spec/shared_examples.rb
yaml-write-stream-2.0.1 spec/shared_examples.rb
yaml-write-stream-2.0.0 spec/shared_examples.rb
yaml-write-stream-1.0.4 spec/shared_examples.rb
yaml-write-stream-1.0.3 spec/shared_examples.rb
yaml-write-stream-1.0.2 spec/shared_examples.rb
yaml-write-stream-1.0.1 spec/shared_examples.rb
yaml-write-stream-1.0.0 spec/shared_examples.rb