Class: Fictium::RSpec::Proxies::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/fictium/rspec/proxies/base.rb

Direct Known Subclasses

Action, Example

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



5
6
7
# File 'lib/fictium/rspec/proxies/base.rb', line 5

def args
  @args
end

#contextObject (readonly)

Returns the value of attribute context.



5
6
7
# File 'lib/fictium/rspec/proxies/base.rb', line 5

def context
  @context
end

#first_argObject (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

#kwargsObject (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_nameObject



19
20
21
# File 'lib/fictium/rspec/proxies/base.rb', line 19

def evaluate_method_name
  :describe
end