Class: Merb::Test::ExampleGroup
- Inherits:
-
Spec::Example::ExampleGroup
- Object
- Spec::Example::ExampleGroup
- Merb::Test::ExampleGroup
- Includes:
- ControllerHelper, RouteHelper, ViewHelper
- Defined in:
- lib/merb-core/test/test_ext/rspec.rb
Class Method Summary collapse
-
.describe(*args, &example_group_block) ⇒ Object
(also: context)
This is a copy of the method in rspec, so we can have describe “…”, :when => “logged in”, and the like.
- .given(*args, &example_group_block) ⇒ Object
Instance Method Summary collapse
-
#initialize(defined_description, &implementation) ⇒ ExampleGroup
constructor
A new instance of ExampleGroup.
Methods included from MultipartRequestHelper
#dispatch_multipart_to, #multipart_fake_request, #multipart_post, #multipart_put
Methods included from RequestHelper
#build_request, #check_request_for_route, #delete, #describe_input, #describe_request, #dispatch_request, #dispatch_to, #dispatch_with_basic_authentication_to, #fake_request, #get, #merge_controller_and_action, #mock_request, #post, #put, #request, #status_code, #with_cookies
Methods included from RouteHelper
Methods included from ViewHelper
#element, #elements, #get_elements, #tag, #tags
Constructor Details
#initialize(defined_description, &implementation) ⇒ ExampleGroup
Returns a new instance of ExampleGroup.
45 46 47 48 |
# File 'lib/merb-core/test/test_ext/rspec.rb', line 45 def initialize(defined_description, &implementation) @_defined_description = defined_description @_implementation = implementation end |
Class Method Details
.describe(*args, &example_group_block) ⇒ Object Also known as: context
This is a copy of the method in rspec, so we can have describe “…”, :when => “logged in”, and the like
53 54 55 56 57 58 59 60 61 |
# File 'lib/merb-core/test/test_ext/rspec.rb', line 53 def describe(*args, &example_group_block) ret = super params = args.last.is_a?(Hash) ? args.last : {} if example_group_block params[:when] = params[:when] || params[:given] ret.module_eval %{it_should_behave_like "#{params[:when]}"} if params[:when] end end |