File tree
Expand file treeCollapse file tree2 files changed
+9
-2
lines changed lib/rspec_api_documentation
Expand file treeCollapse file tree2 files changed
+9
-2
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -18,9 +18,9 @@ module DSL
|
18 | 18 | # +block+:: Block to pass into describe
|
19 | 19 | #
|
20 | 20 | 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 : {} |
22 | 22 | options[:api_doc_dsl] = :resource
|
23 |
| -options[:resource_name] = args.first |
| 23 | +options[:resource_name] = args.first.to_s |
24 | 24 | options[:document] ||= :all
|
25 | 25 | args.push(options)
|
26 | 26 | describe(*args, &block)
|
|
Original file line number | Diff line number | Diff line change |
---|
|
595 | 595 | expect(example.metadata[:document]).to eq(:not_all)
|
596 | 596 | end
|
597 | 597 | 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 |
You can’t perform that action at this time.
0 commit comments