Sha256: b7e4ee1015e0fc47ec7c80fbfcb28787f4dcd402a1c4b880070b7af2edb641d6

Contents?: true

Size: 985 Bytes

Versions: 6

Compression:

Stored size: 985 Bytes

Contents

require 'spec_helper'

describe Support::Attributes do
  
  before(:each) { Object.instance_eval { include Support::Attributes } }
  
  let(:instance) { o = Object.new }
  let(:other) { o = Object.new; o['foo'] = 'bar'; o }
  
  it { should_not be_nil }
  it { should be_empty }
  
  describe '#attributes' do
    
    # before(:all) { class Object; attr_fields :value, %w[ is-numeric punctuation-mode ]; end }

    it 'generates setters for attr_field values' do
      pending
      # lambda { Object.new.is_numeric }.should_not raise_error
    end
    
    it 'generates no other setters' do
      lambda { Object.new.some_other_value }.should raise_error
    end
  end
  
  describe '#merge' do    
    
    it 'merges non-existent values from other object' do
      Object.new.merge(other)['foo'].should == 'bar'
    end
    
    # it 'does not overwrite existing values when merging other object' do
    #   instance.merge(other)['foo'].should == 'bar'
    # end
    
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
citeproc-ruby-0.0.6 spec/support/attributes_spec.rb
citeproc-ruby-0.0.5 spec/support/attributes_spec.rb
citeproc-ruby-0.0.4 spec/support/attributes_spec.rb
citeproc-ruby-0.0.3 spec/support/attributes_spec.rb
citeproc-ruby-0.0.2 spec/support/attributes_spec.rb
citeproc-ruby-0.0.1 spec/support/attributes_spec.rb