Class: Test::Spec::Rails::TestUrl
- Defined in:
- lib/test/spec/rails/test_url.rb
Instance Method Summary collapse
-
#initialize(testcase) ⇒ TestUrl
constructor
A new instance of TestUrl.
- #should_equal(wanted, defaults = {}, extras = {}, message = nil) ⇒ Object (also: #should_be)
- #to_s ⇒ Object
Methods inherited from TestDummy
#inspect, #method_missing, #real_controller, #real_request, #real_response
Constructor Details
#initialize(testcase) ⇒ TestUrl
Returns a new instance of TestUrl.
4 5 6 7 8 |
# File 'lib/test/spec/rails/test_url.rb', line 4 def initialize(testcase) super(testcase) @params = @request.symbolized_path_parameters @path = @request.path end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Test::Spec::Rails::TestDummy
Instance Method Details
#should_equal(wanted, defaults = {}, extras = {}, message = nil) ⇒ Object Also known as: should_be
10 11 12 13 14 15 16 |
# File 'lib/test/spec/rails/test_url.rb', line 10 def should_equal(wanted, defaults={}, extras={}, =nil) if wanted.is_a?(Hash) assert_recognizes(wanted, @path, defaults, ) else assert_generates(wanted, @params, defaults, extras, ) end end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/test/spec/rails/test_url.rb', line 19 def to_s @path end |