jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Compare Action View gem version in more stable way #529

Closed agrobbin closed 6 years ago

agrobbin commented 6 years ago

As soon as a 4.2.x was released where x >= 10 (4.2.10 was released on 9/27), the previous way (introduced in #461) no longer works:

$ ActionView::VERSION::STRING
# => "4.2.10"
$ ActionView::VERSION::STRING >= "4.2.5"
# => false

Gem::Version is smarter about comparing each part rather than doing straight-up string comparison.

ActionView.gem_version was introduced in 4.2.0 (rails/rails#14101), so even though it isn't available in earlier versions of Rails, we're wrapped in a begin..rescue..end block, so that should be OK.

This should resolve https://github.com/jejacks0n/teaspoon/issues/443#issuecomment-332712695.

baburdick commented 6 years ago

Thanks @agrobbin! I've confirmed this works for us.

@jejacks0n: any chance of a pull request merge frenzy soon? :-)

jessedoyle commented 6 years ago

We recently ran into this issue after updating to Rails 4.2.10. I can also confirm that this patch works for us as well.

What needs to be done to get this merged?

Thanks!

jnbt commented 6 years ago

I can also confirm this fixes the problem for Rails 4.2.10

arielscherman commented 6 years ago

As everyone else, can confirm this fixes the issue for Rails 4.2.10.