Module: Surrogate::RSpec

Defined in:
lib/surrogate/rspec.rb,
lib/surrogate/rspec/with_filter.rb,
lib/surrogate/rspec/noun_matcher.rb,
lib/surrogate/rspec/verb_matcher.rb,
lib/surrogate/rspec/block_asserter.rb,
lib/surrogate/rspec/times_predicate.rb,
lib/surrogate/rspec/predicate_matcher.rb,
lib/surrogate/rspec/invocation_matcher.rb,
lib/surrogate/rspec/substitution_matcher.rb,
lib/surrogate/rspec/initialization_matcher.rb,
lib/surrogate/rspec/abstract_failure_message.rb

Defined Under Namespace

Modules: Matchers Classes: AbstractFailureMessage, InitializationMatcher, InvocationMatcher, NounMatcher, PredicateMatcher, SubstitutionMatcher, TimesPredicate, VerbMatcher, WithFilter

Class Method Summary collapse

Class Method Details

.rspec_mocks_loaded=(bool) ⇒ Object



19
20
21
22
# File 'lib/surrogate/rspec.rb', line 19

def rspec_mocks_loaded=(bool)
  @alrady_checked_mocks = true
  @mocks_loaded = bool
end

.rspec_mocks_loaded?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
# File 'lib/surrogate/rspec.rb', line 10

def rspec_mocks_loaded?
  return @mocks_loaded if @alrady_checked_mocks
  @alrady_checked_mocks = true
  require 'rspec/mocks' # can't figure out a way to do this lazily
  @mocks_loaded = true
rescue LoadError
  @mocks_loaded = false
end