Sha256: 53b981c1ec8f43be4621b1773d9673146a7f09d6184b18ee343b8f0a9b8d623c

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Configurable do
  class MyConfig
    include CaptainPlanet::Configurable
    
    attr_configurable :color do
      "red"
    end
    attr_configurable(:width, :height) { 100 }
  end
  
  before(:each) do
    @config = MyConfig.new
  end
  
  it "should read and set configurable attributes" do
    @config.color 'yellow'
    @config.color.should eql('yellow')
  end
  
  it "should support default values" do
    @config.color.should eql('red')
  end
  
  it "should default multiple attributes" do
    @config.width.should eql(100)
    @config.height.should eql(100)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
captain_planet-0.2.0 spec/captain_planet/configurable_spec.rb