Class: Spec::Runner::OptionParser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/cucumber/rspec/disable_option_parser.rb

Overview

Neuters RSpec's option parser. (RSpec's option parser tries to parse ARGV, which will fail when running cucumber)

Constant Summary collapse

NEUTERED_RSPEC =

:nodoc:

Object.new

Class Method Summary collapse

Class Method Details

.method_added(m) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/cucumber/rspec/disable_option_parser.rb', line 14

def self.method_added(m)
  unless @__neutering_rspec
    @__neutering_rspec = true
    define_method(m) do |*a|
      NEUTERED_RSPEC
    end
    @__neutering_rspec = false
  end
end