Sha256: e408551d8a5638ead6de2473c521b72b6242f1163736c22826c71ad89c5c7af5

Contents?: true

Size: 543 Bytes

Versions: 8

Compression:

Stored size: 543 Bytes

Contents

require 'spec_helper'

class Contact
  include SchemaTools::Modules::Attributes
  has_schema_attrs :client
end

describe SchemaTools::Modules::Attributes do

  context 'included' do
    let(:contact){Contact.new}

    it 'should add getter methods' do
      contact.respond_to?(:last_name).should be_true
    end

    it 'should add setter methods' do
      contact.respond_to?('first_name=').should be_true
    end

    it 'should not add setter for readonly properties' do
      contact.respond_to?('id=').should be_false
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
json_schema_tools-0.1.0 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.8 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.7 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.6 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.5 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.4 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.3 spec/schema_tools/modules/attributes_spec.rb
json_schema_tools-0.0.2 spec/schema_tools/modules/attributes_spec.rb