Sha256: feef7a94d5eba4a919d0aca5f457a4421259fbd557188774210e4cfb70be66ee
Contents?: true
Size: 958 Bytes
Versions: 1
Compression:
Stored size: 958 Bytes
Contents
require 'spec_helper' describe Object do let(:klass) { Object } context '#extract_as_option' do it 'should return as option' do klass.send(:extract_as_option, {as: :foobar}).should == :foobar end it 'should raise exception when `as` option is not given' do not_specified_as_option = lambda { klass.send(:extract_as_option, {}) } not_specified_as_option.should raise_exception "You must specify `as` option" end end context '#getter_name' do it 'should return getter name' do klass.send(:getter_name, {as: :dummy_getter}).should == :dummy_getter end end context '#setter_name' do it 'should return setter name' do klass.send(:setter_name, {as: :dummy_setter}).should == :dummy_setter= end end context '#instance_variable_name' do it 'should return proper instance variable name' do klass.send(:instance_variable_name, :foobar).should == :'@foobar' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
named_accessors-1.0 | spec/named_accessors/named_accessor_module_spec.rb |