Sha256: 7d7e6d0de5438c2903de30c6443b12cafd8821c36d3ed570ab5abc28f101f752

Contents?: true

Size: 697 Bytes

Versions: 2

Compression:

Stored size: 697 Bytes

Contents

require 'spec_helper'

describe ConfigureMe::Setting do
  before(:each) do
    @owner = mock('owner') do
      stubs(:define_attribute_methods)
    end
    @setting = ConfigureMe::Setting.new(@owner, :foo, :default => 'bar')
  end

  it { @setting.should respond_to(:name) }
  it { @setting.name.should eql('foo') }
  it { @setting.should respond_to(:default) }
  it { @setting.default.should eql('bar') }

  it "define_methods! should call the owner class's define_attribute_methods with false" do
    owner = mock('owner') do
      expects(:define_attribute_methods).with(true)
    end
    setting = ConfigureMe::Setting.new(owner, :foo, :default => 'bar')
    setting.define_methods!
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
configure_me-0.2.1 spec/configure_me/setting_spec.rb
configure_me-0.1.1 spec/configure_me/setting_spec.rb