Module: RSpec::Expectations::Syntax

Defined in:
opal/opal/rspec/fixes/rspec/expectations/syntax.rb

Instance Method Summary collapse

Instance Method Details

#disable_expect(syntax_host = ::RSpec::Matchers) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'opal/opal/rspec/fixes/rspec/expectations/syntax.rb', line 3

def disable_expect(syntax_host=::RSpec::Matchers)
  return unless expect_enabled?(syntax_host)

  # undef not working on Opal 0.8
  # syntax_host.module_exec do
  #   undef expect
  # end
  syntax_host.remove_method(:expect)
end

#disable_should(syntax_host = default_should_host) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'opal/opal/rspec/fixes/rspec/expectations/syntax.rb', line 13

def disable_should(syntax_host=default_should_host)
  return unless should_enabled?(syntax_host)

  # undef not working on Opal 0.8
  # syntax_host.module_exec do
  #   undef should
  #   undef should_not
  # end
  syntax_host.remove_method(:should)
  syntax_host.remove_method(:should_not)
end