Sha256: 4bfc136475a4d6a3dcfebad63b4c805dc0146eee082a927d02ab43122990206d

Contents?: true

Size: 705 Bytes

Versions: 10

Compression:

Stored size: 705 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

10 entries across 10 versions & 1 rubygems

Version Path
shelly-0.0.43 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.42 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.41 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.41.pre spec/shelly/download_progress_bar_spec.rb
shelly-0.0.40 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.39 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.38 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.37 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.36 spec/shelly/download_progress_bar_spec.rb
shelly-0.0.34 spec/shelly/download_progress_bar_spec.rb