Sha256: 22577fc8d82c297c73795e02cbb4c4db3c10ea464a702e1d1c0590d45c57af8c

Contents?: true

Size: 693 Bytes

Versions: 10

Compression:

Stored size: 693 Bytes

Contents

require 'spec_helper'

include Restspec::Schema

describe Attribute do
  let(:type) { double }

  describe '#example' do
    let(:example) { 'example' }
    let(:attribute) { Attribute.new(:name, type, example: example) }

    it 'returns the example option' do
      expect(attribute.example).to eq(example)
    end
  end

  describe '#can_be_checked?' do
    subject { attribute.can_be_checked? }

    context 'without the option' do
      let(:attribute) { Attribute.new(:name, type, :for => []) }
      it { should eq(false) }
    end

    context 'with the option' do
      let(:attribute) { Attribute.new(:name, type, :for => [:payload]) }
      it { should eq(true) }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
restspec-0.3.2 spec/restspec/schema/attribute_spec.rb
restspec-0.3.1 spec/restspec/schema/attribute_spec.rb
restspec-0.3.0 spec/restspec/schema/attribute_spec.rb
restspec-0.2.6 spec/restspec/schema/attribute_spec.rb
restspec-0.2.5 spec/restspec/schema/attribute_spec.rb
restspec-0.2.4 spec/restspec/schema/attribute_spec.rb
restspec-0.2.3 spec/restspec/schema/attribute_spec.rb
restspec-0.2.2 spec/restspec/schema/attribute_spec.rb
restspec-0.2.1 spec/restspec/schema/attribute_spec.rb
restspec-0.2 spec/restspec/schema/attribute_spec.rb