Sha256: 80b23cdf8c7171b2e36cdac43d4ce7312006ed722fa5cde119eca433d3ddcebb

Contents?: true

Size: 656 Bytes

Versions: 13

Compression:

Stored size: 656 Bytes

Contents

require 'spec_helper'

describe Locomotive::Coal::Resource do

  let(:attributes)  { { 'title' => 'Hello world' } }
  let(:resource)    { described_class.new(attributes) }

  describe 'unknown attribute' do
    subject { resource.name }
    it { expect { subject }.to raise_error }
  end

  describe 'existing attribute' do
    subject { resource.title }
    it { is_expected.to eq 'Hello world' }
  end

  describe '#respond_to?' do
    let(:name) { :title }
    subject { resource.respond_to?(name) }
    it { is_expected.to eq true }

    context 'unknown attribute' do
      let(:name) { :body }
      it { is_expected.to eq false }
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotivecms_coal-1.3.0 spec/unit/resource_spec.rb
locomotivecms_coal-1.3.0.rc1 spec/unit/resource_spec.rb
locomotivecms_coal-1.3.0.rc spec/unit/resource_spec.rb
locomotivecms_coal-1.2.0 spec/unit/resource_spec.rb
locomotivecms_coal-1.1.0 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.rc4 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.rc3 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.rc2 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.rc1 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.pre.beta.2 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.pre.beta.1 spec/unit/resource_spec.rb
locomotivecms_coal-1.0.0.pre.alpha.3 spec/unit/resource_spec.rb