Class: Fictium::RSpec::Proxies::Base
- Inherits:
-
Object
- Object
- Fictium::RSpec::Proxies::Base
- Defined in:
- lib/fictium/rspec/proxies/base.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#first_arg ⇒ Object
readonly
Returns the value of attribute first_arg.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
- #evaluate(block, extra_args, extra_kwargs) ⇒ Object
- #evaluate_method_name ⇒ Object
-
#initialize(context, *args, **kwargs) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(context, *args, **kwargs) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/fictium/rspec/proxies/base.rb', line 6 def initialize(context, *args, **kwargs) @context = context @first_arg = args.shift @args = args @kwargs = kwargs end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/fictium/rspec/proxies/base.rb', line 5 def args @args end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/fictium/rspec/proxies/base.rb', line 5 def context @context end |
#first_arg ⇒ Object (readonly)
Returns the value of attribute first_arg.
5 6 7 |
# File 'lib/fictium/rspec/proxies/base.rb', line 5 def first_arg @first_arg end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
5 6 7 |
# File 'lib/fictium/rspec/proxies/base.rb', line 5 def kwargs @kwargs end |
Instance Method Details
#evaluate(block, extra_args, extra_kwargs) ⇒ Object
13 14 15 16 17 |
# File 'lib/fictium/rspec/proxies/base.rb', line 13 def evaluate(block, extra_args, extra_kwargs) list_arguments = first_arg + args + extra_args key_arguments = extra_kwargs.merge(kwargs).merge(additional_arguments) context.send(evaluate_method_name, *list_arguments, **key_arguments, &block) end |
#evaluate_method_name ⇒ Object
19 20 21 |
# File 'lib/fictium/rspec/proxies/base.rb', line 19 def evaluate_method_name :describe end |