Sha256: 4c87c58090799bc4d875f6896db523f7caa87548eec9c663de5a5e2c85c27f93

Contents?: true

Size: 693 Bytes

Versions: 153

Compression:

Stored size: 693 Bytes

Contents

require "spec_helper"
require "shelly/download_progress_bar"

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

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

  it "should initialize parent with header and given size" do
    @bar.title.should == "Progress"
    @bar.total.should == 4444
  end

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

      @bar.progress_callback.call(10)
      @bar.progress_callback.call(20)
    end
  end
end

Version data entries

153 entries across 153 versions & 1 rubygems

Version Path
shelly-0.4.30 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.29 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.29.pre spec/shelly/download_progress_bar_spec.rb
shelly-0.4.28 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.28.pre2 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.28.pre spec/shelly/download_progress_bar_spec.rb
shelly-0.4.27 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.26 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.26.pre spec/shelly/download_progress_bar_spec.rb
shelly-0.4.25 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.24 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.23 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.23.pre spec/shelly/download_progress_bar_spec.rb
shelly-0.4.22 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.21 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.19 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.18 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.17 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.16 spec/shelly/download_progress_bar_spec.rb
shelly-0.4.15 spec/shelly/download_progress_bar_spec.rb