Skip to content

Instantly share code, notes, and snippets.

@cyril
Last active February 28, 2016 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyril/019f363856b70a1a1263 to your computer and use it in GitHub Desktop.
Save cyril/019f363856b70a1a1263 to your computer and use it in GitHub Desktop.
A spec for the Duck class in Ruby
# duck_spec.rb
require_relative 'duck'
require 'fix'
@bird = Duck.new
Fix.describe @bird do
on :swims do
it { MUST eql 'Swoosh...' }
end
on :speaks do
it { MUST raise_exception NoMethodError }
end
on :sings do
it { MAY eql '♪... ♫...' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment