File tree Expand file tree Collapse file tree
lib/rspec_api_documentation Expand file tree Collapse file tree Original file line number Diff line number Diff 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 number Diff line number Diff line change 595595 expect ( example . metadata [ :document ] ) . to eq ( :not_all )
596596 end
597597end
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