Sha256: 3f860f891ea2837e235e7c8147aaae32423f498fbb20efc6c210ad5831a964e4

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

require 'spec_helper'

describe OpenStudio::Analysis::SupportFiles do
  before :all do
    @s = OpenStudio::Analysis::SupportFiles.new
    expect(@s).to be_a OpenStudio::Analysis::SupportFiles
  end

  it 'should add files' do
    f = 'spec/files/worker_init/first_file.rb'
    @s.add(f)

    expect(@s.size).to eq 1
    expect(@s.files.first[:file]).to eq f

    # add some other items
    @s.add('spec/files/worker_init/second_file.rb')

    expect(@s.size).to eq 2
    @s.each do |f|
      expect(f).to_not be nil
    end
  end

  it 'should remove existing items' do
    f = 'spec/files/worker_init/second_file.rb'
    @s.add(f)

    @s.clear
    expect(@s.size).to eq 0
  end

  it 'should only add existing files'

  it 'should add metadata data'

  it 'should add a directory' do
    @s.clear
    @s.add_files('spec/files/measures/**/*.rb', {d: 'new'})

    expect(@s.size).to eq 7
    expect(@s[0][:metadata][:d]).to eq 'new'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openstudio-analysis-0.4.2 spec/openstudio/support_files_spec.rb