Sha256: ba1edcf3a5e0dee54855d631f9b2794bedb70014977e06db2e1e4a3b571c3009

Contents?: true

Size: 716 Bytes

Versions: 11

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

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

11 entries across 11 versions & 2 rubygems

Version Path
grape-1.6.0 spec/grape/dsl/headers_spec.rb
grape-1.5.3 spec/grape/dsl/headers_spec.rb
grape-1.5.2 spec/grape/dsl/headers_spec.rb
grape-1.5.1 spec/grape/dsl/headers_spec.rb
grape-1.5.0 spec/grape/dsl/headers_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/spec/grape/dsl/headers_spec.rb
grape-1.4.0 spec/grape/dsl/headers_spec.rb
grape-1.3.3 spec/grape/dsl/headers_spec.rb
grape-1.3.2 spec/grape/dsl/headers_spec.rb
grape-1.3.1 spec/grape/dsl/headers_spec.rb
grape-1.3.0 spec/grape/dsl/headers_spec.rb