Sha256: c146683176b4e8c1c8bfd459aaff6c899742c0f3a896b7c7f6fe4b5b58d2e6a1

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

require 'spec_helper'

describe Shoes::Radio do
  include_context "dsl app"

  subject(:radio) { Shoes::Radio.new(app, parent, group, input_opts, input_block) }
  let(:group) { :a_group }

  it_behaves_like "checkable"
  it_behaves_like "object with state"

  it_behaves_like "object with style" do
    let(:subject_without_style) { Shoes::Radio.new(app, parent, group) }
    let(:subject_with_style) { Shoes::Radio.new(app, parent, group, arg_styles) }
  end

  # only one radio in a group can be checked

  describe "#initialize" do
    it "sets accessors" do
      expect(radio.parent).to eq(parent)
      expect(radio.group).to eq(group)
    end
  end

  describe "#group=" do
    it "changes the group" do
      radio.group = "New Group"
      expect(radio.group).to eq("New Group")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shoes-core-4.0.0.pre7 spec/shoes/radio_spec.rb
shoes-core-4.0.0.pre6 spec/shoes/radio_spec.rb
shoes-core-4.0.0.pre5 spec/shoes/radio_spec.rb