Sha256: bff56038abd82ce7f9f32523c9740104a4a39edc500dcc88149fc159be4b99b8

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require 'tataru'

describe Tataru::Representations::ArrayRepresentation do
  it 'has no dependencies for empty array' do
    rep = Tataru::Representations::ArrayRepresentation.new([])
    expect(rep.dependencies).to eq []
  end

  it 'has no dependencies for array with only literals' do
    rep = Tataru::Representations::ArrayRepresentation.new(['hi'])
    expect(rep.dependencies).to eq []
  end

  it 'has dependencies for each resource' do
    rr = Tataru::Representations::ResourceRepresentation.new('file', Tataru::BaseResourceDesc.new, {})
    rep = Tataru::Representations::ArrayRepresentation.new([rr])
    expect(rep.dependencies).to eq ['file']
  end

  it 'has dependencies for every resource' do
    rr1 = Tataru::Representations::ResourceRepresentation.new('file1', Tataru::BaseResourceDesc.new, {})
    rr2 = Tataru::Representations::ResourceRepresentation.new('file2', Tataru::BaseResourceDesc.new, {})
    rep = Tataru::Representations::ArrayRepresentation.new([rr1, rr2, 'awd'])

    expect(rep.dependencies).to eq ['file1', 'file2']
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tataru-0.2.0 spec/representations/array_representation_spec.rb