Sha256: 6dbaba38d2160bacf60b89175806f9236f986dc7c1d9adf1276ad3aab5e08edd

Contents?: true

Size: 685 Bytes

Versions: 21

Compression:

Stored size: 685 Bytes

Contents

require 'spec_helper'

module Grape
  module DSL
    module HeadersSpec
      class Dummy
        include Grape::DSL::Headers
      end
    end
    describe Headers do
      subject { HeadersSpec::Dummy.new }

      describe '#header' do
        describe 'set' do
          before do
            subject.header 'Name', 'Value'
          end

          it 'returns value' do
            expect(subject.header['Name']).to eq 'Value'
            expect(subject.header('Name')).to eq 'Value'
          end
        end

        it 'returns nil' do
          expect(subject.header['Name']).to be nil
          expect(subject.header('Name')).to be nil
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
grape-0.15.0 spec/grape/dsl/headers_spec.rb