Class: CheckAuth::Output
- Inherits:
-
Object
- Object
- CheckAuth::Output
- Defined in:
- lib/rspec_check_auth/check_auth/output.rb
Overview
Handles generating the code to eval from all the request objects
Class Method Summary collapse
Class Method Details
.generate_steps_for(format, objects) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rspec_check_auth/check_auth/output.rb', line 5 def self.generate_steps_for format, objects # Wrap each format in a new describe block o = [%Q{describe "as #{format.to_s.upcase}" do}] # Run through each step objects.each do |request| o << " it \"should return 401 for \#{request.method.to_s.upcase} \#{request.action}\" do\n\#{request.method}(\#{request.action.inspect}\#{\", \" + request.params.inspect})\n\n\#{CheckAuth.checking_block(format)}\n end\n EOF\n end\n o << \"end\"\n o.join(\"\\n\")\nend\n" |