Sha256: b9a32076380e2cfb84de813dac3f513b796d92f990088d0eb6471cda36108184
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
require 'spec_helper' describe Shoes::Swt::Progress do include_context "swt app" let(:text) { "TEXT" } let(:dsl) { double('dsl', app: shoes_app).as_null_object } let(:real) { double('real', disposed?: real_disposed).as_null_object } let(:real_disposed) { false } subject { Shoes::Swt::Progress.new dsl, swt_app } before :each do allow(swt_app).to receive(:real) allow(::Swt::Widgets::ProgressBar).to receive(:new) { real } end it_behaves_like "movable element" it_behaves_like "updating visibility" it "should have a method called fraction=" do expect(subject).to respond_to :fraction= end it "should multiply the value by 100 when calling real.selection" do expect(real).to receive(:selection=).and_return(55) subject.fraction = 0.55 end it "should round up correctly" do expect(real).to receive(:selection=).and_return(100) subject.fraction = 0.999 end context "with disposed real element" do let(:real_disposed) { true } it "shouldn't set selection" do expect(real).not_to receive(:selection=) subject.fraction = 0.55 end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shoes-swt-4.0.0.pre7 | spec/shoes/swt/progress_spec.rb |