Module: RSpec::Arguments::ExampleGroup
- Defined in:
- lib/rspec/arguments/example_group.rb
Instance Method Summary collapse
-
#arg(name, position = nil, &block) ⇒ Object
TODO support anonymous positional: arg(0) { ‘0’ }.
-
#arg_block(name = '', &block) ⇒ Object
Similar to ‘arg(name, position, &block)`, but binds this argument as the &block argument provided to the instance initializer.
-
#method_arg(name, position = nil, &block) ⇒ Object
Similar to ‘arg(name, position, &block)`, but binds this argument to the described method, instead of described class.
-
#method_arg_block(name = '', &block) ⇒ Object
Similar to ‘arg_block(name, &block)`, but binds this argument to the described method, instead of described class.
Instance Method Details
#arg(name, position = nil, &block) ⇒ Object
TODO support anonymous positional: arg(0) { ‘0’ }
28 29 30 |
# File 'lib/rspec/arguments/example_group.rb', line 28 def arg(name, position = nil, &block) _arg(POSITIONAL_ARG, KEYWORD_ARG, name, position, &block) end |
#arg_block(name = '', &block) ⇒ Object
Similar to ‘arg(name, position, &block)`, but binds this argument as the &block argument provided to the instance initializer.
37 38 39 |
# File 'lib/rspec/arguments/example_group.rb', line 37 def arg_block(name = '', &block) _arg_block(BLOCK_ARG, name, &block) end |
#method_arg(name, position = nil, &block) ⇒ Object
Similar to ‘arg(name, position, &block)`, but binds this argument to the described method, instead of described class.
46 47 48 |
# File 'lib/rspec/arguments/example_group.rb', line 46 def method_arg(name, position = nil, &block) _arg(METHOD_POSITIONAL_ARG, METHOD_KEYWORD_ARG, name, position, &block) end |
#method_arg_block(name = '', &block) ⇒ Object
Similar to ‘arg_block(name, &block)`, but binds this argument to the described method, instead of described class.
55 56 57 |
# File 'lib/rspec/arguments/example_group.rb', line 55 def method_arg_block(name = '', &block) _arg_block(METHOD_BLOCK_ARG, name, &block) end |