Commit Graph

15 Commits

Author SHA1 Message Date
Elliot Winkler eb4d9e5cb2 Bump version to 2.7.0 2014-09-03 00:38:41 -06:00
Pedro Nascimento 1f24f04da3 Using RSpec 3 for development. 2014-08-14 12:16:54 -04:00
Elliot Winkler 888665745f Bump version to 2.6.2 2014-07-18 18:08:30 -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 4d8faed1c4 Generate docs using YARD 2014-06-20 16:41:32 -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
Elliot Winkler 1511ed9161 Bump version to 2.6.1 2014-04-30 17:52:47 -04:00
Elliot Winkler cdcea5adb4 Bump to version 2.6.1.rc2 2014-04-27 10:18:26 -04:00
Elliot Winkler d7a3548249 Bump to version 2.6.1.rc1 2014-04-22 10:24:05 -05:00
Elliot Winkler 8fa9d8c789 Bump to version 2.6.0 2014-04-12 15:42:19 -06:00
Mauro George 714cf87d78 Add support to rails 4.1.0 2014-04-08 17:41:31 -03:00
Elliot Winkler 602be16e8e Use the new appraisal executable in 1.0.0.beta1 2014-02-22 14:47:01 -07:00
Mauro George b805cc3a05 Add pry as development dependency 2014-02-11 14:55:31 -05:00
Elliot Winkler b9998891f0 Bump to version 2.5.0 2014-01-10 15:37:34 -07:00
Elliot Winkler e3c64779de Add Appraisal for Rails 4.0.1 2013-12-18 22:32:28 -07:00