Sha256: 80e75bafc26367a946c6bf68c79afa9f1fa4026114466ecff42a193967e0a012

Contents?: true

Size: 525 Bytes

Versions: 3

Compression:

Stored size: 525 Bytes

Contents

require 'spec_helper'
require 'wgif/info_displayer'

describe WGif::InfoDisplayer do

  let(:cache) { described_class.new }

  before do
    @mock_stdout = StringIO.new
    @real_stdout, $stdout = $stdout, @mock_stdout
  end

  after do
    $stdout = @real_stdout
  end

  it 'prints out a file size to the command line' do
    file_name = "fake_file_name.rb"
    allow(File).to receive(:size).with(file_name).and_return('1048576')
    cache.display(file_name)
    expect(@mock_stdout.string).to match(/1.000 MB/)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wgif-0.5.4 spec/unit/wgif/info_displayer_spec.rb
wgif-0.5.3 spec/unit/wgif/info_displayer_spec.rb
wgif-0.5.2 spec/unit/wgif/info_displayer_spec.rb