1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
Commit graph

28 commits

Author SHA1 Message Date
Josh Kalderimis
dca7c96bc9 Use the new beta build env on Travis
faster vm boot times
more cpus
more ram
better network

docs coming soon
2014-11-19 05:11:29 -07:00
Elliot Winkler
fc3bb53a46 Add Ruby 2.1.4 to Travis 2014-11-05 09:54:12 -07:00
Elliot Winkler
1cbfcb7cc8 Tell Travis how now to run the tests 2014-11-05 09:54:11 -07:00
Elliot Winkler
b845451088 Enable caching 2014-10-21 01:23:51 -06:00
Elliot Winkler
0c91ffe7ba Use the correct appraisal names in .travis.yml 2014-07-02 09:24:17 -06:00
Elliot Winkler
12543ede2e Use same assertion class as Rails, if loaded
Given this scenario:

* Using Rails 4.1
* Gemfile has `gem 'shoulda-matchers', require: false`
* spec_helper has `require 'shoulda/matchers'` following
  `require 'rspec/rails'`
* Using Spring to run tests

matchers that delegate to assertions in Rails (e.g. `render_template`
and `route`) will fail in the wrong way if used. They fail because in
order to use these assertions, we expect that the assertions will
raise a specific exception, an exception that corresponds to whichever
test framework that Rails is using. For Rails versions that used
Test::Unit, this is Test::Unit::AssertionFailedError. For current Rails
versions, which now use Minitest, this exception is Minitest::Assertion.

The problem is that instead of asking Rails which exception class it's
using, we are trying to detect this exception class ourselves (for
cases in which Rails is not being used). This leads to the wrong class
being detected: when using a Rails version that uses Minitest, we choose
Test::Unit::AssertionFailedError as the class. This happens using the
exact scenario above because even though shoulda-matchers is loaded
after rspec-rails, rspec-rails itself defines
Test::Unit::AssertionFailedError.

Also add Cucumber tests that confirms this exact scenario works.
2014-06-27 14:06:47 -06:00
Elliot Winkler
f13e069f09 Add missing test dependences to Appraisals
Since as of commit 2748b75087, we no
longer install dependencies inside of the Rails app that is generated
and used to run all of the tests, we have to require all of the
dependencies that the app would install inside of the appropriate
Appraisals.

This was mostly straightforward except for some workarounds with the
turn gem:

* Rails 3.1 requires two versions of turn depending on which Ruby
  version you're using. On 1.9.2, it uses turn 0.9.2; after 1.9.2, it
  uses ~> 0.9.3. To accommodate this we have to have two versions of the
  Rails 3.1 appraisal which declare the different turn versions.
* Rails 3.1 also loads the turn gem even if, in the Gemfile for the app,
  turn is declared with `require: false`. This causes a problem while
  running our tests because turn actually requires minitest/autorun,
  which adds a hook so when Ruby exits, Minitest tests are run. Because
  we're already using RSpec, Minitest will try to re-run the `rspec`
  command we ran within a Minitest environment. This will fail since we
  are using RSpec-specific command line options to run the tests.
  Unfortunately there's no way to shut off minitest/autorun after it's
  been required, so we have to monkey-patch Minitest's #run method so
it's a no-op.
2014-05-21 09:50:46 -06:00
Mauro George
714cf87d78 Add support to rails 4.1.0 2014-04-08 17:41:31 -03:00
Elliot Winkler
e3c64779de Add Appraisal for Rails 4.0.1 2013-12-18 22:32:28 -07:00
Elliot Winkler
4440445baf Auto-retry bundle install when Travis runs tests
`bundle install` doesn't always work -- sometimes it runs into errors
making HTTP requests, for whatever reason. This will cause Travis to
fail which is pretty annoying.

* Travis supplies an executable called `travis_retry` which will
  automatically retry the command up to 3 times before really failing.
  Tell Travis to use this when it runs `bundle install` before it
  runs tests.
* In spec_helper, we create a Rails app and use this within the
  test suite. This will also run `bundle install`. Unfortunately we
  can't use `travis_retry` for this as it's a function and is not
  available to us in Ruby-land, so use our own retry logic.
2013-12-03 11:09:01 -05:00
Matt Daubert
63b06019dd Test Rails 4.0 on Travis CI 2013-08-23 09:29:14 -04:00
Jason Draper
530303300b Specify bundle install for travis.
* Thanks to @sikachu!

Travis will now runs `bundle install --deployment` if it detects that
the project has `Gemfile.lock`. However, there's a problem in Bundler
deployment install that cause it not installing `bundler` gem into
`vendor/bundle` directory, which causes `require 'bundler'` to fail.
2013-08-01 14:04:04 -04:00
Derek Prior
cd61fb6085 Ruby 2.0 Support
* Add Ruby 2.0 support to the Appraisals
* Update travis to test 2.0.0 with the 3.2 gemfile. Clean up the travis
  matrix to favor the include syntax over exclude.
* Edit gemfile.locks to point to relative paths.
2013-04-19 17:11:45 -04:00
Derek Prior
c638665b08 Remove traces of 1.8 support
Shoulda Matchers 2.0 removed support for 1.8. This change removes Ruby
1.8 tests from travis and sets the minimum Ruby version in the gemspec.
2013-04-19 12:55:58 -04:00
Dan Croak
d5632b012d Allow Travis failures for Ruby 1.8.7 2013-03-18 23:55:47 -07:00
Erik Michaels-Ober
0b9763dbf7 Don't test REE [ci skip]
Ruby Enterprise Edition has reached its end of life and should be fully
compatible with MRI 1.8.7. Testing on both is wasting resources. See:
http://blog.phusion.nl/2012/02/21/ruby-enterprise-edition-1-8-7-2012-02-released-end-of-life-imminent/
2012-12-03 08:26:13 -08:00
Gabe Berke-Williams
79d8ea07e2 Test against Rails 3.2 in Travis. 2012-10-01 13:03:15 -04:00
Prem Sichanugrist
4eb27be231 Correct travis-ci allow_failures syntax 2012-05-11 17:51:05 -04:00
Prem Sichanugrist
369f9b26ca Allow shoulda-matchers to fail on rbx and jruby for now 2012-05-11 14:13:16 -04:00
Gabe Berke-Williams
ffc3b02d2f Remove unnecessary Travis configuration. 2012-04-10 23:24:47 -04:00
Prem Sichanugrist
94dbf7455b Change rbx-2.0 to rbx-18mode 2012-03-02 10:09:58 -05:00
Prem Sichanugrist
3d9439030b Update set_the_flash_matcher to also duplicate the used set to fix a bug in Rubinius
Tests now also passed on Rubinius 2.0
2011-09-19 01:05:07 +07:00
Prem Sichanugrist
4450c865db [Travis] Re-enable notification 2011-09-18 22:02:22 +07:00
Prem Sichanugrist
4a97d9dd9f [Travis] Update build configuration 2011-09-18 21:37:55 +07:00
Prem Sichanugrist
8007a1ac23 [Travis] Make sure the known_hosts file exists 2011-09-16 16:01:13 +07:00
Prem Sichanugrist
45242cf91a Add another server of Github to known hosts 2011-09-16 15:57:48 +07:00
Prem Sichanugrist
a1eb080d12 Tell Travis CI to use the correct gemfile 2011-09-12 18:04:01 +07:00
Prem Sichanugrist
272699f312 Add travis build 2011-09-12 17:48:27 +07:00