This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; RSpec stack example: http://rspec.info/examples.html | |
;;; Implementation | |
(ns specjure.examples | |
(:refer-clojure :exclude [empty? peek]) | |
(:use specjure)) | |
(defn stack [] | |
(ref ())) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clojure (:use specjure)) | |
(it + "without arguments returns 0" | |
(should = (+) 0)) | |
(it + "with a single argument returns the argument" | |
(should = 1 (+ 1)) | |
(should = 1337 (+ 1337))) | |
(it + "with multiple arguments returns the sum of the arguments" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clojure (:use specjure)) | |
(describe + "without arguments" | |
(it "returns 0" | |
(should = 0 (+)))) | |
(describe + "with a single argument" | |
(it "returns the argument" | |
(should = 1 (+ 1)) | |
(should = 1337 (+ 1337)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module BugWalkSimulation | |
describe Bug, "#dead?" do | |
it "should be false when the number of moves is less than the moves lifetime" do | |
bug = new_bug(:moves_lifetime => 3) | |
bug.expects(:number_of_moves).returns(2) | |
bug.should_not be_dead | |
end | |
it "should be true when the number of moves is greater than the moves lifetime" do | |
bug = new_bug(:moves_lifetime => 2) |
NewerOlder