Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tiny spec refactor

  • Loading branch information...
commit 65f2b4f5a1567cd7d2d173b5311205b2a24546f3 1 parent 36e41a3
@geeksam geeksam authored
Showing with 39 additions and 39 deletions.
  1. +39 −39 spec/kookaburra/test_helpers_spec.rb
View
78 spec/kookaburra/test_helpers_spec.rb
@@ -40,58 +40,58 @@
end
end
- describe "#match_mental_model_of" do
+ describe "methods related to the mental model" do
let(:mm) { Kookaburra.configuration.mental_model }
- def sanity_check
- match_mental_model_of(:widgets).should be_kind_of(Kookaburra::MentalModel::Matcher)
- end
+ describe "#match_mental_model_of" do
+ def sanity_check
+ match_mental_model_of(:widgets).should be_kind_of(Kookaburra::MentalModel::Matcher)
+ end
- before(:each) do
- sanity_check
- mm.widgets[:foo] = 'FOO'
- end
+ before(:each) do
+ sanity_check
+ mm.widgets[:foo] = 'FOO'
+ end
- it "does a positive match" do
- ['FOO'].should match_mental_model_of(:widgets)
- end
+ it "does a positive match" do
+ ['FOO'].should match_mental_model_of(:widgets)
+ end
- it "does a negative match" do
- ['BAR'].should_not match_mental_model_of(:widgets)
+ it "does a negative match" do
+ ['BAR'].should_not match_mental_model_of(:widgets)
+ end
end
- end
-
- describe "#assert_mental_model_of" do
- let(:mm) { Kookaburra.configuration.mental_model }
- let(:test_case) {
- Object.new.tap do |obj|
- obj.extend Kookaburra::TestHelpers
+ describe "#assert_mental_model_of" do
+ let(:test_case) {
+ Object.new.tap do |obj|
+ obj.extend Kookaburra::TestHelpers
- def obj.assert(predicate, message)
- predicate || message
+ def obj.assert(predicate, message)
+ predicate || message
+ end
end
- end
- }
+ }
- before(:each) do
- mm.widgets[:foo] = 'FOO'
- end
+ before(:each) do
+ mm.widgets[:foo] = 'FOO'
+ end
- it "does a positive assertion" do
- result = test_case.assert_mental_model_of(:widgets, ['FOO'])
- result.should be_true
- end
+ it "does a positive assertion" do
+ result = test_case.assert_mental_model_of(:widgets, ['FOO'])
+ result.should be_true
+ end
- it "does a negative assertion" do
- result = test_case.assert_mental_model_of(:widgets, ['BAR'])
- result.should =~ /expected widgets to match the user's mental model, but/
- end
+ it "does a negative assertion" do
+ result = test_case.assert_mental_model_of(:widgets, ['BAR'])
+ result.should =~ /expected widgets to match the user's mental model, but/
+ end
- it "does a negative assertion with a custom message" do
- psa = 'Put the razor down and step away!'
- result = test_case.assert_mental_model_of(:widgets, ['YAK'], psa)
- result.should == psa
+ it "does a negative assertion with a custom message" do
+ psa = 'Put the razor down and step away!'
+ result = test_case.assert_mental_model_of(:widgets, ['YAK'], psa)
+ result.should == psa
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.