Permalink
Browse files

Added Rspec-detection and integration

  • Loading branch information...
1 parent 10feba9 commit 02a9753d8bd57a526f9f8d926b16e97416d2bb04 @jferris jferris committed Jan 31, 2009
Showing with 28 additions and 25 deletions.
  1. +4 −18 lib/shoulda.rb
  2. +0 −7 lib/shoulda/matchers.rb
  3. +5 −0 lib/shoulda/rspec.rb
  4. +19 −0 lib/shoulda/test_unit.rb
View
@@ -1,23 +1,9 @@
-require 'shoulda/context'
-require 'shoulda/proc_extensions'
-require 'shoulda/assertions'
-require 'shoulda/macros'
-require 'shoulda/helpers'
-require 'shoulda/autoload_macros'
-require 'shoulda/rails' if defined? RAILS_ROOT
-
module Shoulda
VERSION = "2.0.6"
end
-module Test # :nodoc: all
- module Unit
- class TestCase
- extend Shoulda::ClassMethods
- include Shoulda::Assertions
- extend Shoulda::Macros
- include Shoulda::Helpers
- end
- end
+if defined? Spec
+ require 'shoulda/rspec'
+else
+ require 'shoulda/test_unit'
end
-
View
@@ -1,7 +0,0 @@
-require 'shoulda/active_record/matchers'
-
-module Shoulda
- module Matchers # :nodoc:
- include Shoulda::ActiveRecord::Matchers
- end
-end
View
@@ -0,0 +1,5 @@
+require 'shoulda/active_record/matchers'
+
+Spec::Runner.configure do |config|
+ config.include Shoulda::ActiveRecord::Matchers, :type => :model
+end
View
@@ -0,0 +1,19 @@
+require 'shoulda/context'
+require 'shoulda/proc_extensions'
+require 'shoulda/assertions'
+require 'shoulda/macros'
+require 'shoulda/helpers'
+require 'shoulda/autoload_macros'
+require 'shoulda/rails' if defined? RAILS_ROOT
+
+module Test # :nodoc: all
+ module Unit
+ class TestCase
+ extend Shoulda::ClassMethods
+ include Shoulda::Assertions
+ extend Shoulda::Macros
+ include Shoulda::Helpers
+ end
+ end
+end
+

0 comments on commit 02a9753

Please sign in to comment.