Sha256: cb9c1005014401a92f71bbd8602f14166cf0616e57a950156328ea234c0c05d1

Contents?: true

Size: 574 Bytes

Versions: 53

Compression:

Stored size: 574 Bytes

Contents

require File.expand_path('spec/spec_helper')

describe Ruco::OptionAccessor do
  let(:options){ Ruco::OptionAccessor.new }

  it "can be accessed like a hash" do
    options[:xx].should == nil
    options[:xx] = 1
    options[:xx].should == 1
  end

  it "can be written" do
    options.foo = true
    options[:foo].should == true
  end

  it "can access nested keys" do
    options.foo_bar = 1
    options.history_size = 1
    options.nested(:history).should == {:size => 1}
  end

  it "has empty hash for nested key" do
    options.nested(:history).should == {}
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
ruco-0.2.12 spec/ruco/option_accessor_spec.rb
ruco-0.2.11 spec/ruco/option_accessor_spec.rb
ruco-0.2.10 spec/ruco/option_accessor_spec.rb
ruco-0.2.9 spec/ruco/option_accessor_spec.rb
ruco-0.2.8 spec/ruco/option_accessor_spec.rb
ruco-0.2.7 spec/ruco/option_accessor_spec.rb
ruco-0.2.6 spec/ruco/option_accessor_spec.rb
ruco-0.2.5 spec/ruco/option_accessor_spec.rb
ruco-0.2.4 spec/ruco/option_accessor_spec.rb
ruco-0.2.3 spec/ruco/option_accessor_spec.rb
ruco-0.2.2 spec/ruco/option_accessor_spec.rb
ruco-0.2.1 spec/ruco/option_accessor_spec.rb
ruco-0.2.0 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta12 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta11 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta10 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta9 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta8 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta7 spec/ruco/option_accessor_spec.rb
ruco-0.2.0.beta6 spec/ruco/option_accessor_spec.rb