Class: CmQuiz::Review::BaseReview
- Inherits:
-
Object
- Object
- CmQuiz::Review::BaseReview
- Includes:
- CmQuiz::ReviewHelper
- Defined in:
- lib/cm_quiz/review/base_review.rb
Direct Known Subclasses
CreateIdea, DeleteIdea, GetIdeas, GetUserInfo, LoginUser, SignUpUser, UpdateIdea
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #build_test_result(test_case, passed = true, message = nil) ⇒ Object
- #perform ⇒ Object
- #run ⇒ Object
- #test_request ⇒ Object
Methods included from CmQuiz::ReviewHelper
#be, #be_nil, #be_within, #eq, #expect
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/cm_quiz/review/base_review.rb', line 6 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/cm_quiz/review/base_review.rb', line 6 def path @path end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
6 7 8 |
# File 'lib/cm_quiz/review/base_review.rb', line 6 def verb @verb end |
Instance Method Details
#build_test_result(test_case, passed = true, message = nil) ⇒ Object
22 23 24 |
# File 'lib/cm_quiz/review/base_review.rb', line 22 def build_test_result(test_case, passed = true, = nil) [test_case, passed, ] end |
#perform ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/cm_quiz/review/base_review.rb', line 9 def perform run build_test_result(test_request) rescue RSpec::Expectations::ExpectationNotMetError => e build_test_result(test_request, false, e.) rescue => e build_test_result(test_request, false, e.) end |
#run ⇒ Object
18 19 20 |
# File 'lib/cm_quiz/review/base_review.rb', line 18 def run raise "Method `run` should be implemented on class #{self.class}" end |
#test_request ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/cm_quiz/review/base_review.rb', line 26 def test_request { verb: @verb, path: @path, options: @options } end |