Sha256: cf242f77b0aa8f5e8b3d1394902a928bc76da17b9f6806ae8399edbda44f704f

Contents?: true

Size: 626 Bytes

Versions: 20

Compression:

Stored size: 626 Bytes

Contents

require "spec_helper"
require "shelly/download_progress_bar"

describe Shelly::DownloadProgressBar do
  before do
    $stdout.stub(:print)
    @bar = Shelly::DownloadProgressBar.new(4444)
  end

  it "should inherith from ProgressBar" do
    @bar.should be_kind_of(ProgressBar::Base)
  end

  it "should initialize parent with size" do
    @bar.total.should == 4444
  end

  describe "#progress_callback" do
    it "should return callback for updating progress bar" do
      @bar.should_receive(:total=).with(1000)
      @bar.should_receive(:progress=).with(10)


      @bar.progress_callback.call(10, 1000)
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shelly-0.5.7 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.6 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.5 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.4 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.3 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.2 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.1 spec/shelly/download_progress_bar_spec.rb
shelly-0.5.0 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.42 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.41 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.40 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.39 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.38 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.37 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.36 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.35 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.34 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.33 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.32 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.31 spec/shelly/download_progress_bar_spec.rb