Commit Graph

22 Commits

Author SHA1 Message Date
Elliot Winkler 190007155e Remove auto-detection of Rails / test framework 2015-02-09 10:52:51 -07:00
Elliot Winkler c22d7c89e0 Extract examples in README to inline documentation 2014-06-20 16:41:27 -06:00
Anthony Williams 7f425948f8 Only include ActiveRecord matchers if AR is defined
Fixes cases where you may be using ActiveModel without ActiveRecord.

Also add a test for loading without ActiveRecord.

The Cucumber feature creates a Gemfile containing ActiveModel and
shoulda-matchers, and then asserts that both can be loaded without any
errors.

The ActiveModel version used will match that of the Rails version
specified in the Appraisal Gemfile; and if no such version can be
determined, the latest will be used.

Closes #480.
2014-04-15 21:25:12 -06:00
Elliot Winkler cd9594603e Remove warning under Minitest 5
Under Minitest 5 (or a Rails 4.1 project), you will get a warning

    MiniTest::Unit::TestCase is now Minitest::Test.

when you attempt to run tests. This is because shoulda-matchers requires
'test/unit/testcase', even if Test::Unit is not being used.

It is not a good idea for shoulda-matchers to require *anything* that
the user may not be using, whether it's Test::Unit or RSpec. We should
assume that by the time shoulda-matchers is required, the user has
already required all of whatever test framework they are using, not none
or even some of that framework.
2014-04-04 15:07:28 -06:00
Damian Galarza cb858b961e Ensure independent matchers are widely available
The current form of including independent matchers for TestUnit does not
end up including it in `ActiveSupport::TestCase` tests in a Rails app.
This ensures that `Shoulda::Matchers::Independent` are available in
`ActiveSupport::TestCase`.
2014-03-21 14:54:22 -04:00
Damian Galarza and Mason Fischer f7e4c7d6cb Restore delegation matchers
This commit reverts 77dc477c
2014-03-16 13:38:16 -04:00
Piotr Usewicz 676ce88d39 Don't extend non-existing modules
Fixes an issue where a Rails project skips the test unit railtie
completely, eg:

# require "rails/test_unit/railtie"
2013-09-30 12:45:22 +01:00
Elliot Winkler e64868493e Hook into ActiveSupport::TestCase, not Test::Unit::TestCase
In Rails 4, ActiveSupport::TestCase no longer inherits from
Test::Unit::TestCase. In fact, everything uses ActiveSupport::TestCase
so there is no real reason for us to extend Test::Unit::TestCase.
2013-08-16 16:17:26 -06:00
Melissa Xie 6b105ba7cd Remove 'have_sent_email' matcher
* See issue #252
2013-04-03 13:08:27 -04:00
Melissa Xie d3525f129e Remove 'delegate_method' matcher
* See issue #252
2013-04-03 13:08:26 -04:00
Ben Atkins b3232e0966 Require 'rspec/core' instead of 'rspec' in RSpec integration file
* See discussions in #248 and #259
2013-03-21 13:57:02 -04:00
Todd Bealmear 3fcf3e44ae Reverting to require "rspec". 2013-03-19 11:55:45 -07:00
Dan Croak b79360441d Loosen Bourne dependency to ~> 1.3
> Use a pessimistic version in the Gemfile for gems that follow semantic
> versioning, such as rspec, factory_girl, and capybara.

https://github.com/thoughtbot/guides/tree/master/best-practices

* Upgrade dependencies so specs run on new Bourne.
* Use semantic versions in step_definitions gems.
* Rely on ActiveSupport::Dependencies.clear for reloading constants.
  http://rkh.im/code-reloading
2013-03-18 23:31:11 -07:00
Aleksei Gusev 112db47649 Rewritten rspec integration to use RSpec's configure for matchers loading. 2012-12-25 14:24:08 -08:00
Reade Harris a117db9ff7 Respond to feedback. 2012-10-19 09:22:32 -04:00
Reade Harris 2377fb44af Add #delegate_method matcher. 2012-10-19 09:22:32 -04:00
Gabe Berke-Williams f1a3dca5b9 Update to modern thoughtbot style. 2012-03-16 12:15:23 -04:00
Markus Schwed 1fa2f21365 Load ActiveModel matchers for ActiveRecord and ActiveModel (for using for another ORM/classes) 2011-05-09 18:17:35 +02:00
Markus Schwed 16466ca2a9 Fixed small bug in test_unit (thx jasonm) 2011-05-06 09:57:36 -07:00
Markus Schwed 2a54fdb28d Seperate ActiveRecord and ActiveModel related matchers 2011-05-06 15:56:36 +02:00
Ryan McGeary 9c9580c55b Moved dependencies from the Gemfile to the gemspec
* The Gemfile now contains just the source and a single `gemspec` declaration
* See http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/

* Also had to break out the modules under integrations/rspec into their nested equivalents (load order?)
2011-01-31 16:45:13 -05:00
Joe Ferris 56b0a0439e Move into the Matchers namespace 2010-12-15 17:34:19 -05:00