Merged
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,9 +18,9 @@ module DSL
# +block+:: Block to pass into describe
#
def resource(*args, &block)
options = if args.last.is_a?(Hash) then args.pop else {} end
options = args.last.is_a?(Hash) ? args.pop : {}
options[:api_doc_dsl] = :resource
options[:resource_name] = args.first
options[:resource_name] = args.first.to_s
options[:document] ||= :all
args.push(options)
describe(*args, &block)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -583,3 +583,10 @@
expect(example.metadata[:document]).to eq(:not_all)
end
end

class Order; end
resource Order do
it 'should have a string resource_name' do |example|
expect(example.metadata[:resource_name]).to eq(Order.to_s)
end
end