Sha256: f63bc49baf523d5900f99e4f28c7a8b5ff2c428c6dfb87340f02cc02e7079aee

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

require "shoes/spec_helper"

describe Shoes::Button do
  include_context "dsl app"
  let(:input_opts) { {:left => left, :top => top, :width => width,
                      :height => height, :margin => margin, :state => "disabled"} }

  let(:left)   { 13 }
  let(:top)    { 44 }
  let(:width)  { 131 }
  let(:height) { 137 }
  let(:margin) { 14 }

  subject(:button) { Shoes::Button.new(app, parent, "text", input_opts, input_block) }

  it_behaves_like "movable object"
  it_behaves_like "object with state"
  it_behaves_like "object with dimensions"

  it { should respond_to :click }
  it { should respond_to :focus }

  describe "initialize" do
    its(:parent) { should eq(parent) }
    its(:blk) { should eq(input_block) }
    its(:text) { should eq("text") }
    its(:width) { should eq(131) }
    its(:height) { should eq(137) }
    its(:state) { should eq("disabled") }
  end

  describe "relative dimensions" do
    subject { Shoes::Button.new(app, parent, "text", relative_opts, input_block) }
    it_behaves_like "object with relative dimensions"
  end

  describe "negative dimensions" do
    subject { Shoes::Button.new(app, parent, "text", negative_opts, input_block) }
    it_behaves_like "object with negative dimensions"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-4.0.0.pre1 spec/shoes/button_spec.rb