Name: mockical-creatures
Owner: Turing School of Software & Design
Description: repo for an exercise on testing using mocks and stubs
Created: 2015-02-08 23:37:25.0
Updated: 2017-01-22 15:27:55.0
Pushed: 2015-02-09 18:31:31.0
Homepage: null
Size: 123
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Consider a mythical Dwarf whose public API consists of a single method:
Dwarf#mine(mountain)
The provided mountain object should respond to the instance method
#mine
by randomly returning one of 3 strings:
The Dwarf API is already implemented under lib/dwarf.rb
. The objective of
this exercise is to practice retroactively testing the API without
actually writing the Mountain
class.
Due to the random nature of mining, our tests will be more reliable if
we control the Mountain
interface manually using mocks and stubs.
Additionally mountains are large and generally a pain to move around.
Using mock stand-ins will make our test much lighter-weight.
Try filling in the tests 3 times.
Minitest::Mock
)rspec-mocks
library