Skip to content

Commit 7103e64

Browse files
committed
Fix: headers defaults to nil.
1 parent c76b016 commit 7103e64

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/grape-swagger-rails.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "grape-swagger-rails/engine"
22

33
module GrapeSwaggerRails
4-
class Options < Struct.new(:url, :api_key_name, :api_key_type, :api_auth, :headers, :app_name, :app_url, :authentication_proc)
4+
class Options < OpenStruct
55
def authenticate_with(&block)
66
self.authentication_proc = block
77
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'spec_helper'
2+
3+
describe GrapeSwaggerRails do
4+
context "#options" do
5+
subject do
6+
GrapeSwaggerRails.options
7+
end
8+
it 'is an instance of Options' do
9+
expect(subject).to be_a GrapeSwaggerRails::Options
10+
end
11+
it 'defaults headers to an empty hash' do
12+
expect(subject.headers).to eq({})
13+
end
14+
end
15+
end

0 commit comments

Comments
 (0)