Module: Spec::Example::ArgsAndOptions

Included in:
DSL::Main, ExampleGroupFactory::ClassMethods, ExampleGroupMethods, Runner::Configuration
Defined in:
lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb

Defined Under Namespace

Modules: WithOptions

Instance Method Summary collapse

Instance Method Details

#add_options(args, options = {}) ⇒ Object

:nodoc:



9
10
11
12
13
14
# File 'lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb', line 9

def add_options(args, options={}) # :nodoc:
  args << {} unless Hash === args.last
  args.extend WithOptions
  args.options.merge!(options)
  args.options
end

#args_and_options(*args) ⇒ Object

:nodoc:



4
5
6
7
# File 'lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb', line 4

def args_and_options(*args) # :nodoc:
  options = Hash === args.last ? args.pop : {}
  return args, options
end

#set_location(options, location) ⇒ Object

:nodoc:



16
17
18
# File 'lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb', line 16

def set_location(options, location) # :nodoc:
  options[:location] ||= location
end