everydayrails / everydayrails-rspec-2017

Sample source for the 2017 edition of Everyday Rails Testing with RSpec.
http://rspectutorial.com
312 stars 247 forks source link

Specify Ruby version in this repository #83

Closed JunichiIto closed 6 years ago

JunichiIto commented 6 years ago

When I ran the specs in this repository against Ruby 2.5.1, I got the following error:

Failures:

  1) Sign in user signs in
     Failure/Error: click_link "Sign In"

     SyntaxError:
       /Users/jnito/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '{', expecting keyword_end
       ...ion only: [:create, :destroy] { request.env["devise.skip_tim...
       ...                              ^
       /Users/jnito/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', expecting keyword_end
       ..."devise.skip_timeout"] = true }
       ...                              ^
     # ./spec/features/sign_ins_spec.rb:12:in `block (2 levels) in <top (required)>'
     # -e:1:in `<main>'

Finished in 9.24 seconds (files took 3.78 seconds to load)
70 examples, 1 failure

Failed examples:

rspec ./spec/features/sign_ins_spec.rb:10 # Sign in user signs in

This error is related to this issue.

I think some of these actions are required:

ruralocity commented 6 years ago

I'm going to see what I can do about this without a major overhaul. I've always tried to avoid locking people into a specific version of Ruby, so I'm going to try upgrading Devise first. If that doesn't work, I'll fall back to a specific Ruby.

ruralocity commented 6 years ago

To clarify, I try to handle supported versions of Ruby ... so I'd like this to work with Ruby 2.3 or newer, at least. Maybe I should set up CI to build across multiple Rubies.

JunichiIto commented 6 years ago

I think "CI to build across multiple Rubies" is good solution 👍

ruralocity commented 6 years ago

I was able to update Devise and test manually in Ruby 2.4 and Ruby 2.5. Aside from merge conflicts in Gemfile.lock from chapter to chapter, there were no issues.

I will push this up in the next few days when I release an updated version of the book.

ruralocity commented 6 years ago

I released a version that uses the updated Devise. I'm working on CI builds across multiple Rubies as a separate project.