Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 23 lines (19 sloc) 0.547 kB
bbc5cf5 @nakajima added the ability to specify custom responses... maybe.
authored
1 require 'spec/spec_helper'
2
3 describe Sinatra::Hat::HashMutator do
4 attr_reader :mutator, :hash
5
6 before(:each) do
7 @hash = {
8 :success => proc { :ftw! },
9 :failure => proc { :fail }
10 }
11 @mutator = Sinatra::Hat::HashMutator.new(hash)
12 end
13
14 it "lets you alter the success key of the passed in hash" do
15 mutator.success { :pwnd! }
16 hash[:success][].should == :pwnd!
17 end
18
19 it "lets you alter the failure key of the passed in hash" do
20 mutator.failure { :pwnd! }
21 hash[:failure][].should == :pwnd!
22 end
23 end
Something went wrong with that request. Please try again.