Skip to content

Commit

Permalink
Add support for Rails 5 (#8)
Browse files Browse the repository at this point in the history
* Add a gemfile to test with Rails 5

* Add support for Rails 5

see also:
- rails/rails@3806eb7
- rails/rails@78a5124

* Rails 5 requires Ruby 2.2.2+

* Remove the lock file

* Fix to suit the feedback on the Pull Request #8

* Oops!
  • Loading branch information
sinsoku authored and mizoR committed May 4, 2016
1 parent ab4f38a commit 2842d77
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ tmp
*.a
mkmf.log
log/*.log
gemfiles/*.lock
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ rvm:
- 2.2.4
- 2.3.0

gemfile:
- Gemfile
- gemfiles/Gemfile-rails.5.0.0.beta4

matrix:
exclude:
- rvm: 2.0.0
gemfile: gemfiles/Gemfile-rails.5.0.0.beta4
- rvm: 2.1.8
gemfile: gemfiles/Gemfile-rails.5.0.0.beta4

before_install:
- gem update bundler

Expand Down
9 changes: 9 additions & 0 deletions gemfiles/Gemfile-rails.5.0.0.beta4
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

gemspec path: '../'

gem 'rails', '5.0.0.beta4'

group :test do
gem 'coveralls', require: false
end
6 changes: 5 additions & 1 deletion lib/active_decorator/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ def self.enable(example)
ActionController::Base
end
controller = Class.new(base_class).new
controller.request = ActionController::TestRequest.new
controller.request = if ActionController::TestRequest.respond_to?(:create)
ActionController::TestRequest.create
else
ActionController::TestRequest.new
end
if ActiveDecorator::ViewContext.respond_to?(:current=)
ActiveDecorator::ViewContext.current = controller.view_context
else
Expand Down

0 comments on commit 2842d77

Please sign in to comment.