public
Fork of thoughtbot/shoulda
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/rmm5t/shoulda.git
Added a `should_fail` macro to help test failure scenarios in the core shoulda 
tests
Ryan McGeary (author)
Wed Sep 03 17:37:28 -0700 2008
commit  f4984945f118f34a27dfc1fddd912be7466448f2
tree    04ded924252e39ca48b3821518112b69d9c7cb32
parent  9065d991580e77239bf78159153b51380b1b3433
...
5
6
7
8
 
9
10
11
12
 
13
14
15
16
 
17
18
19
...
25
26
27
28
 
29
30
31
 
 
...
5
6
7
 
8
9
10
11
 
12
13
14
15
 
16
17
18
19
...
25
26
27
 
28
29
30
31
32
33
0
@@ -5,15 +5,15 @@ ENV['RAILS_ENV'] = 'sqlite3'
0
 rails_root = File.dirname(__FILE__) + '/rails_root'
0
 
0
 require "#{rails_root}/config/environment.rb"
0
- 
0
+
0
 # Load the testing framework
0
 require 'test_help'
0
 silence_warnings { RAILS_ENV = ENV['RAILS_ENV'] }
0
- 
0
+
0
 # Run the migrations
0
 ActiveRecord::Migration.verbose = false
0
 ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
0
- 
0
+
0
 # Setup the fixtures path
0
 Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), "fixtures")
0
 
0
@@ -25,7 +25,9 @@ class Test::Unit::TestCase #:nodoc:
0
       Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
0
     end
0
   end
0
- 
0
+
0
   self.use_transactional_fixtures = false
0
   self.use_instantiated_fixtures  = false
0
 end
0
+
0
+require 'test/fail_macros'
...
44
45
46
 
 
 
 
47
...
44
45
46
47
48
49
50
51
0
@@ -44,4 +44,8 @@ class UserTest < Test::Unit::TestCase
0
   should_only_allow_numeric_values_for :ssn
0
 
0
   should_have_readonly_attributes :name
0
+
0
+  should_fail do
0
+    should_protect_attributes :name, :age
0
+  end
0
 end

Comments