Sha256: 419f0465a5109c3241f9ae3f473225c66ecd68babb4c10d79e8fb832949ade7a

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 Bytes

Contents

require 'spec_helper'

describe Response, '#valid?' do
  subject { object.valid? }

  context 'with status and body' do
    let(:object) { described_class.build(Response::Status::OK, {}, double('Body')) }

    it { should be(true) }

    it_should_behave_like 'an idempotent method'
  end

  context 'without body' do
    let(:object) { described_class.build.with_status(Response::Status::OK) }

    it { should be(false) }

    it_should_behave_like 'an idempotent method'
  end

  context 'without status' do
    let(:object) { described_class.build.with_body(double('Body')) }

    it { should be(false) }

    it_should_behave_like 'an idempotent method'
  end

  context 'without status and body' do
    let(:object) { described_class.build }

    it { should be(false) }

    it_should_behave_like 'an idempotent method'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
response-0.0.4 spec/unit/response/valid_predicate_spec.rb