Module: Surrogate::RSpec::Matchers

Defined in:
lib/surrogate/rspec.rb

Instance Method Summary collapse

Instance Method Details

#asked_for(method_name) ⇒ Object



54
55
56
# File 'lib/surrogate/rspec.rb', line 54

def asked_for(method_name)
  NounMatcher.new method_name
end

#asked_if(method_name) ⇒ Object



46
47
48
# File 'lib/surrogate/rspec.rb', line 46

def asked_if(method_name)
  PredicateMatcher.new method_name
end

#be_substitutable_for(original_class, options = {}) ⇒ Object



26
27
28
# File 'lib/surrogate/rspec.rb', line 26

def be_substitutable_for(original_class, options={})
  SubstitutionMatcher.new original_class, options
end

#have_been_asked_for_its(method_name) ⇒ Object



50
51
52
# File 'lib/surrogate/rspec.rb', line 50

def have_been_asked_for_its(method_name)
  NounMatcher.new method_name
end

#have_been_asked_if(method_name) ⇒ Object



42
43
44
# File 'lib/surrogate/rspec.rb', line 42

def have_been_asked_if(method_name)
  PredicateMatcher.new method_name
end

#have_been_initialized_with(*initialization_args, &block) ⇒ Object



58
59
60
# File 'lib/surrogate/rspec.rb', line 58

def have_been_initialized_with(*initialization_args, &block)
  InitializationMatcher.new *initialization_args, &block
end

#have_been_told_to(method_name) ⇒ Object



34
35
36
# File 'lib/surrogate/rspec.rb', line 34

def have_been_told_to(method_name)
  VerbMatcher.new method_name
end

#initialized_with(*initialization_args, &block) ⇒ Object



62
63
64
# File 'lib/surrogate/rspec.rb', line 62

def initialized_with(*initialization_args, &block)
  InitializationMatcher.new *initialization_args, &block
end

#substitute_for(original_class, options = {}) ⇒ Object



30
31
32
# File 'lib/surrogate/rspec.rb', line 30

def substitute_for(original_class, options={})
  SubstitutionMatcher.new original_class, options
end

#told_to(method_name) ⇒ Object



38
39
40
# File 'lib/surrogate/rspec.rb', line 38

def told_to(method_name)
  VerbMatcher.new method_name
end