Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
Search Repo:
small changes

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@441 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
tsaleh (author)
Sat Apr 05 07:36:58 -0700 2008
commit  fabe6b7724b5fad0f86c6503ed5801de6ed3020f
tree    9d3b7250d75f5a2a758265c09ed613e7dd1c5fe4
parent  915f76bcb910dea88905cd8f83fe895bc7eaa23f
...
98
99
100
 
101
102
103
...
382
383
384
 
385
 
386
387
388
...
98
99
100
101
102
103
104
...
383
384
385
386
387
388
389
390
391
0
@@ -98,6 +98,7 @@ module ThoughtBot # :nodoc:
0
       def should_protect_attributes(*attributes)
0
         get_options!(attributes)
0
         klass = model_class
0
+
0
         attributes.each do |attribute|
0
           attribute = attribute.to_sym
0
           should "protect #{attribute} from mass updates" do
0
@@ -382,7 +383,9 @@ module ThoughtBot # :nodoc:
0
       #
0
       def should_have_and_belong_to_many(*associations)
0
         get_options!(associations)
0
+
0
         klass = model_class
0
+
0
         associations.each do |association|
0
           should "should have and belong to many #{association}" do
0
             assert klass.reflect_on_association(association), "#{klass.name} does not have any relationship to #{association}"
...
44
45
46
47
 
48
49
50
...
44
45
46
 
47
48
49
50
0
@@ -44,7 +44,7 @@ module ThoughtBot # :nodoc:
0
       # assert_contains(['a', '1'], /not there/) => fails
0
       def assert_contains(collection, x, extra_msg = "")
0
         collection = [collection] unless collection.is_a?(Array)
0
- msg = "#{x.inspect} not found in #{collection.to_a.inspect} " + extra_msg
0
+ msg = "#{x.inspect} not found in #{collection.to_a.inspect} #{extra_msg}"
0
         case x
0
         when Regexp: assert(collection.detect { |e| e =~ x }, msg)
0
         else assert(collection.include?(x), msg)

Comments

    No one has commented yet.