Sha256: 68421d81f4d3bf52956f1d0860f1bbde555bae80e8d816d0f0aa3865a4083d75

Contents?: true

Size: 552 Bytes

Versions: 6

Compression:

Stored size: 552 Bytes

Contents

require "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

6 entries across 6 versions & 1 rubygems

Version Path
ruco-0.2.18 spec/ruco/option_accessor_spec.rb
ruco-0.2.17 spec/ruco/option_accessor_spec.rb
ruco-0.2.16 spec/ruco/option_accessor_spec.rb
ruco-0.2.15 spec/ruco/option_accessor_spec.rb
ruco-0.2.14 spec/ruco/option_accessor_spec.rb
ruco-0.2.13 spec/ruco/option_accessor_spec.rb