turingschool/mockical-creatures

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.