Module: Bogus::MockingDSL

Included in:
Minitest
Defined in:
lib/bogus/mocking_dsl.rb

Instance Method Summary collapse

Instance Method Details

#any(klass) ⇒ Object



39
40
41
# File 'lib/bogus/mocking_dsl.rb', line 39

def any(klass)
  Bogus::SameClass.new(klass)
end

#any_argsObject



27
28
29
# File 'lib/bogus/mocking_dsl.rb', line 27

def any_args
  Bogus::AnyArgs
end

#anythingObject



43
44
45
# File 'lib/bogus/mocking_dsl.rb', line 43

def anything
  Bogus::Anything
end

#fake(*args, &block) ⇒ Object



3
4
5
# File 'lib/bogus/mocking_dsl.rb', line 3

def fake(*args, &block)
  Bogus.fake_for(*args, &block)
end

#fake_class(name, opts = {}) ⇒ Object



7
8
9
# File 'lib/bogus/mocking_dsl.rb', line 7

def fake_class(name, opts = {})
  Bogus.fake_class(name, opts)
end

#have_received(*args) ⇒ Object



15
16
17
# File 'lib/bogus/mocking_dsl.rb', line 15

def have_received(*args)
  Bogus.have_received(*args)
end

#make_duck(*args) ⇒ Object



23
24
25
# File 'lib/bogus/mocking_dsl.rb', line 23

def make_duck(*args)
  Bogus.make_duck(*args)
end

#matches(&block) ⇒ Object



35
36
37
# File 'lib/bogus/mocking_dsl.rb', line 35

def matches(&block)
  Bogus::MatchesArgument.new(&block)
end

#mock(*args) ⇒ Object



19
20
21
# File 'lib/bogus/mocking_dsl.rb', line 19

def mock(*args)
  Bogus.create_mock(*args)
end

#stub(*args) ⇒ Object



11
12
13
# File 'lib/bogus/mocking_dsl.rb', line 11

def stub(*args)
  Bogus.create_stub(*args)
end

#with(&block) ⇒ Object



31
32
33
# File 'lib/bogus/mocking_dsl.rb', line 31

def with(&block)
  Bogus::WithArguments.new(&block)
end