Class: Rspec::Bash::CallConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/bash/command/call_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCallConfiguration

Returns a new instance of CallConfiguration.



8
9
10
# File 'lib/rspec/bash/command/call_configuration.rb', line 8

def initialize
  @call_configuration = []
end

Instance Attribute Details

#call_configurationObject

Returns the value of attribute call_configuration.



6
7
8
# File 'lib/rspec/bash/command/call_configuration.rb', line 6

def call_configuration
  @call_configuration
end

Instance Method Details

#add_output(content, target, args = []) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/rspec/bash/command/call_configuration.rb', line 17

def add_output(content, target, args = [])
  current_conf = create_or_get_conf(args)
  type = determine_output_type(target)
  current_conf[:outputs][target] = {
    target: target,
    type: type,
    content: content.to_s
  }
end

#get_best_call_conf(args = []) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/rspec/bash/command/call_configuration.rb', line 27

def get_best_call_conf(args = [])
  call_conf_arg_matcher = Util::CallConfArgumentListMatcher.new(@call_configuration)
  best_call_conf = call_conf_arg_matcher.get_best_call_conf(args)
  remove_args_from_conf(
    interpolate_output_targets(
      copy_conf(best_call_conf),
      args
    )
  )
end

#set_exitcode(exitcode, args = []) ⇒ Object



12
13
14
15
# File 'lib/rspec/bash/command/call_configuration.rb', line 12

def set_exitcode(exitcode, args = [])
  current_conf = create_or_get_conf(args)
  current_conf[:exitcode] = exitcode
end