File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ module DSL
1818
# +block+:: Block to pass into describe
1919
#
2020
def resource(*args, &block)
21-
options = if args.last.is_a?(Hash) then args.pop else {} end
21+
options = args.last.is_a?(Hash) ? args.pop : {}
2222
options[:api_doc_dsl] = :resource
23-
options[:resource_name] = args.first
23+
options[:resource_name] = args.first.to_s
2424
options[:document] ||= :all
2525
args.push(options)
2626
describe(*args, &block)
Original file line numberDiff line numberDiff line change
@@ -595,3 +595,10 @@
595595
expect(example.metadata[:document]).to eq(:not_all)
596596
end
597597
end
598+
599+
class Order; end
600+
resource Order do
601+
it 'should have a string resource_name' do |example|
602+
expect(example.metadata[:resource_name]).to eq(Order.to_s)
603+
end
604+
end

0 commit comments

Comments
 (0)