Sha256: dfd89a63584327a1287fea3b98921ff89ba25ab9f52f091f61a8e71c0c0f511b

Contents?: true

Size: 703 Bytes

Versions: 2

Compression:

Stored size: 703 Bytes

Contents

require "spec_helper"

describe Redistat::Options do

  before(:each) do
    @helper = OptionsHelper.new
    @helper.parse_options(:wtf => 'dude', :foo => 'booze')
  end

  it "should #parse_options" do
    @helper.options[:hello].should == 'world'
    @helper.options[:foo].should == 'booze'
    @helper.options[:wtf].should == 'dude'
    @helper.raw_options.should_not have_key(:hello)
  end

  it "should create option_accessors" do
    @helper.hello.should == 'world'
    @helper.hello('woooo')
    @helper.hello.should == 'woooo'
  end

end

class OptionsHelper
  include Redistat::Options

  option_accessor :hello

  def default_options
    { :hello => 'world',
      :foo => 'bar' }
  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redistat-0.5.0 spec/options_spec.rb
redistat-0.4.0 spec/options_spec.rb