Skip to content
This repository
Browse code

Style.

  • Loading branch information...
commit f84180504d732521c36f2c54ffcea80c2b94d4c2 1 parent 0ecb774
Gabe Berke-Williams authored March 23, 2012
24  spec/shoulda/active_record/query_the_database_matcher_spec.rb
... ...
@@ -1,9 +1,7 @@
1 1
 require 'spec_helper'
2 2
 
3 3
 describe Shoulda::Matchers::ActiveRecord::QueryTheDatabaseMatcher do
4  
-
5 4
   if ::ActiveRecord::VERSION::MAJOR == 3 && ::ActiveRecord::VERSION::MINOR >= 1
6  
-
7 5
     before do
8 6
       @parent = define_model :litter do
9 7
         has_many :kittens
@@ -13,47 +11,43 @@
13 11
       end
14 12
     end
15 13
 
16  
-    it "should accept the correct number of queries when there is a single query" do
  14
+    it "accepts the correct number of queries when there is a single query" do
17 15
       @parent.should query_the_database(1.times).when_calling(:count)
18 16
     end
19 17
 
20  
-    it "should accept any number of queries when no number is specified" do
  18
+    it "accepts any number of queries when no number is specified" do
21 19
       @parent.should query_the_database.when_calling(:count)
22 20
     end
23 21
 
24  
-    it "should reject any number of queries when no number is specified" do
  22
+    it "rejects any number of queries when no number is specified" do
25 23
       @parent.should_not query_the_database.when_calling(:to_s)
26 24
     end
27 25
 
28  
-    it "should accept the correct number of queries when there are two queries" do
  26
+    it "accepts the correct number of queries when there are two queries" do
29 27
       nonsense = lambda do
30 28
         @parent.create.kittens.create
31 29
       end
32 30
       nonsense.should query_the_database(2.times).when_calling(:call)
33 31
     end
34 32
 
35  
-    it "should reject the wrong number of queries" do
  33
+    it "rejects the wrong number of queries" do
36 34
       @parent.should_not query_the_database(10.times).when_calling(:count)
37 35
     end
38 36
 
39  
-    it "should accept fewer than the specified maximum" do
  37
+    it "accepts fewer than the specified maximum" do
40 38
       @parent.should query_the_database(5.times).or_less.when_calling(:count)
41 39
     end
42 40
 
43  
-    it "should pass arguments to the method to examine" do
  41
+    it "passes arguments to the method to examine" do
44 42
       model = stub("Model", :count => nil)
45 43
       model.expects(:count).with("arguments")
46 44
       model.should_not query_the_database.when_calling(:count).with("arguments")
47 45
     end
48  
-
49 46
   else
50  
-
51 47
     it "should raise an exception on Rails < 3.1" do
52  
-      lambda {
  48
+      lambda do
53 49
         @parent.should query_the_database(1.times).when_calling(:count)
54  
-      }.should raise_exception
  50
+      end.should raise_exception
55 51
     end
56  
-
57 52
   end
58  
-
59 53
 end

0 notes on commit f841805

Please sign in to comment.
Something went wrong with that request. Please try again.