spec/shoes/swt/border_spec.rb in shoes-swt-4.0.0.pre6 vs spec/shoes/swt/border_spec.rb in shoes-swt-4.0.0.pre7
- old
+ new
@@ -6,13 +6,16 @@
let(:left) { 55 }
let(:top) { 77 }
let(:width) { 222 }
let(:height) { 111 }
let(:corners) { 0 }
- let(:dsl) { double("dsl object", element_width: width, element_height: height,
- element_left: left, element_top: top, parent: parent,
- strokewidth: 1, curve: corners,hidden: false).as_null_object }
+ let(:dsl) do
+ double("dsl object", element_width: width, element_height: height,
+ element_left: left, element_top: top, parent: parent,
+ translate_left: 0, translate_top: 0,
+ strokewidth: 1, curve: corners, hidden: false).as_null_object
+ end
subject { Shoes::Swt::Border.new dsl, swt_app }
context "#initialize" do
it { is_expected.to be_an_instance_of(Shoes::Swt::Border) }
@@ -33,19 +36,19 @@
describe "square corners" do
let(:corners) { 0 }
specify "draws rect" do
- expect(gc).to receive(:draw_round_rectangle).with(left+sw/2, top+sw/2, width-sw, height-sw, corners*2, corners*2)
+ expect(gc).to receive(:draw_round_rectangle).with(left + sw / 2, top + sw / 2, width - sw, height - sw, corners * 2, corners * 2)
subject.paint_control(event)
end
end
describe "round corners" do
let(:corners) { 13 }
specify "draws rect" do
- expect(gc).to receive(:draw_round_rectangle).with(left+sw/2, top+sw/2, width-sw, height-sw, corners*2, corners*2)
+ expect(gc).to receive(:draw_round_rectangle).with(left + sw / 2, top + sw / 2, width - sw, height - sw, corners * 2, corners * 2)
subject.paint_control(event)
end
end
end
end