Sha256: 0210d96da8696417b7a06f26f5038ea48bbcfc7c68ef86f52afd19624ff7ce5a

Contents?: true

Size: 626 Bytes

Versions: 7

Compression:

Stored size: 626 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Filesystem Api' do
  include_context 'uses aruba API'

  def expand_path(*args)
    @aruba.expand_path(*args)
  end

  describe '#file_size' do
    let(:name) { @file_name }
    let(:path) { @file_path }
    let(:size) { file_size(name) }

    context 'when file exist' do
      before :each do
        File.open(path, 'w') { |f| f.print 'a' }
      end

      it { expect(size).to eq 1 }
    end

    context 'when file does not exist' do
      let(:name) { 'non_existing_file' }
      it { expect { size }.to raise_error RSpec::Expectations::ExpectationNotMetError }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aruba-0.14.9 spec/aruba/api/filesystem/file_size_spec.rb
aruba-0.14.8 spec/aruba/api/filesystem/file_size_spec.rb
aruba-0.14.7 spec/aruba/api/filesystem/file_size_spec.rb
aruba-0.14.6 spec/aruba/api/filesystem/file_size_spec.rb
aruba-0.14.5 spec/aruba/api/filesystem/file_size_spec.rb
aruba-0.14.4 spec/aruba/api/filesystem/file_size_spec.rb
aruba-0.14.3 spec/aruba/api/filesystem/file_size_spec.rb