Sha256: 1f3298651391f87ec54969012da4450690821865d0a3efb593c36528d8d04786

Contents?: true

Size: 968 Bytes

Versions: 5

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'

describe Caracal::Core::Models::HeaderModel do
  subject do
    described_class.new
  end

  #-------------------------------------------------------------
  # Public Methods
  #-------------------------------------------------------------

  describe 'public method tests' do

    #=============== DATA ACCESSORS ====================

    describe 'data tests' do

      # .contents
      describe '.contents' do
        it { expect(subject.contents).to be_a(Array) }
      end
    end

    #=============== VALIDATION ========================

    describe '.valid?' do
      describe 'when content provided' do
        before { allow(subject).to receive(:contents).and_return(['a']) }

        it { expect(subject.valid?).to eq true }
      end

      describe 'when content not provided' do
        before { allow(subject).to receive(:contents).and_return([]) }

        it { expect(subject.valid?).to eq false }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
caracal_the_curve-1.4.6 spec/lib/caracal/core/models/header_model_spec.rb
caracal_the_curve-1.4.5 spec/lib/caracal/core/models/header_model_spec.rb
caracal_the_curve-1.4.4 spec/lib/caracal/core/models/header_model_spec.rb
caracal_the_curve-1.4.3 spec/lib/caracal/core/models/header_model_spec.rb
caracal_the_curve-1.4.2 spec/lib/caracal/core/models/header_model_spec.rb