Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Capybara 2 #206

Merged
merged 1 commit into from
Mar 23, 2013
Merged

Conversation

infertux
Copy link
Contributor

Hi,

Those cukes failing with Capybara 2 were bothering me. The main issue was that Capybara 2 doesn't look for text in hidden DOM elements anymore (which makes sense!) so we now need to use a JS-enabled driver. I went ahead and picked capybara-webkit. Poltergeist is cool too because truly headless thanks to PhantomJS but it requires Ruby 1.9.2+. You might want to use another one. I also tweaked a bit the fake Rack app to serve other resources such as JS files.

There's probably a minor overhead (although I can't see any difference locally) running cukes with JS but I thought it'd be more relevant for integration tests.

Also references 239db29.

colszowka added a commit that referenced this pull request Mar 23, 2013
@colszowka colszowka merged commit b198b02 into simplecov-ruby:master Mar 23, 2013
@colszowka
Copy link
Collaborator

Merged, thanks :) I will probably go and switch it to poltergeist as in the past I've had less headaches with that and it recently got capybara 2 support. Especially on plain debian I bumped into loads of trouble trying to get qt compiled as it is not supplied with the packages.

colszowka added a commit that referenced this pull request Mar 23, 2013
Also added more specific development dependency version matchers to gemspec
@infertux
Copy link
Contributor Author

The issue with Poltergeist is that it won't even install on rubies < 1.9.2: https://travis-ci.org/colszowka/simplecov/jobs/5738890. You could still wrap references to it within if RUBY_VERSION >= '1.9.2' but that's a bit messy IMHO.

@colszowka
Copy link
Collaborator

Hmmmm, crap. I didn't realize it would outright fail to install for non-1.9 ruby :( And that after I finally made the build pass reliably on travis earlier today 😿

What is most annoying is that I'm not even interested in using poltergeist on Ruby <1.9, but it needs to get installed for those as well when listed in the simplecov gemspec, and that fails due to poltergeists gemspec

I think the best way would probably be to shuffle poltergeist over to the actual Gemfile. Since it's a dev dependency only anyway that should be good enough. There, some kind of platform depending switch could ensure it's not installed on pre 1.9.

colszowka added a commit that referenced this pull request Mar 23, 2013
Gemfile because poltergeist cannot be installed on Ruby < 1.9.2
as per it's gemspec. The integration suite is meant for 1.9+
only, anyway.

See #206
@colszowka
Copy link
Collaborator

Ok, made the cuke suite and it's dependencies available on 1.9+ only. Travis build for MRIs and rbx/jruby 1.8 passed, waiting for JRuby 1.9, but it seems that this particular problem with installing poltergeist is resolved now :)

@infertux
Copy link
Contributor Author

Sorry for the delay, that sounds good.

I see you like the '1.9+'.respond_to? :encoding trick, it looks a bit misleading to me but I'm just being fussy ;). Is there any reason not to prefer RUBY_VERSION > '1.9'?

Btw, just curious: do you plan to drop Ruby 1.8 support in a future big release? It'll EOL in June and this would save troubles like this one, MultiJSON, etc. - especially since there's no coverage report available on 1.8 and this is only to make sure SimpleCov doesn't break anything.

Thanks and kudos for the steady green build :)

@colszowka
Copy link
Collaborator

Actually there used to be some reason not to use RUBY_VERSION in the past. It may be that this constant was not available in Ruby 1.8.6 or something like that, but yeah, probably nowadays just using that should be much easier. Another example of how we should always question our habits :)

Yeah, I think I'll be dropping 1.8 support soon. I'll be wrapping a 0.8.0 release over easter, I might modify the current warning when using a 1.8 implementation to warn that simplecov will be dropping support for that in the next release, be it 0.9 or 1.0.

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Mar 15, 2014
v0.8.2, 2013-11-20 ([changes](simplecov-ruby/simplecov@v0.8.1...v0.8.2))
=====================

## Bugfixes

  * Replaced the locking behaviour [via lockfile gem](simplecov-ruby/simplecov#185) with
    plain Ruby explicit file locking when merging results. This should make simplecov merging to behave well
    on Windows again.
    See [#258](simplecov-ruby/simplecov#258) and
    [#223](simplecov-ruby/simplecov#223) (thanks to @tomykaira)

v0.8.1, 2013-11-10 ([changes](simplecov-ruby/simplecov@v0.8.0...v0.8.1))
=====================

## Bugfixes

  * Fixed a regression introduced in 0.8.0 - the Forwardable STDLIB module is now required explicitly.
    See [#256](simplecov-ruby/simplecov#256) (thanks to @kylev)

v0.8.0, 2013-11-10 ([changes](simplecov-ruby/simplecov@v0.7.1...v0.8.0))
=====================

**Note: Yanked the same day because of the regression that 0.8.1 fixes, see above**

## TL;DR

It's been way too long since the last official release 0.7.1, but this was partly due to it proving itself
quite stable in most circumstances. This release brings various further stability improvements to result set merging
(especially when working with parallel_tests), the configuration, source file encodings, and command name guessing.

The 0.8 line is the last one to cooperate with Ruby < 1.9. Starting with 0.9, SimpleCov will assume to be running in
Ruby 1.9+, and will not try to detect or bail silently on older Ruby versions. An appropriate deprecation warning
has been added.

## Features

  * Configuration blocks now have access to variables and methods outside of the block's scope.
    See [#238](simplecov-ruby/simplecov#238) (thanks to @ms-tg)
  * You can now have a global `~/.simplecov` configuration file.
    See [#195](simplecov-ruby/simplecov#195) (thanks to @spagalloco)
  * simplecov-html now uses the MIT-licensed colorbox plugin. Some adjustments when viewing source files,
    including retaining the currently open file on refresh have been added.
    See [simplecov-html #15](simplecov-ruby/simplecov-html#15) (thanks to @chetan)
  * Adds support for Rails 4 command guessing, removes default group `vendor/plugins`.
    See [#181](simplecov-ruby/simplecov#181) and
    [#203](simplecov-ruby/simplecov#203) (thanks to @semanticart and @phallstrom)
  * You can now load simplecov without the default settings by doing `require 'simplecov/no_defaults'`
    or setting `ENV['SIMPLECOV_NO_DEFAULTS']`. Check `simplecov/defaults` to see what preconfigurations are getting
    dropped by using this. See [#209](simplecov-ruby/simplecov#209) (thanks to @ileitch)
  * The result set merging now uses the `lockfile` gem to avoid race conditions.
    See [#185](simplecov-ruby/simplecov#185) (thanks to @jshraibman-mdsol).
  * Automatically detect the usage of parallel_tests and adjust the command name with the test env number accordingly,
    See [#64](simplecov-ruby/simplecov#64) and
    [#185](simplecov-ruby/simplecov#185) (thanks to @jshraibman-mdsol).

## Enhancements

  * Rename adapters to "profiles" given that they are bundles of settings. The old adapter methods are
    deprecated, but remain available for now.
    See [#207](simplecov-ruby/simplecov#207) (thanks to @mikerobe)
  * Tweaks to the automatic test suite naming. In particular, `rspec/features` should now
    be correctly attributed to RSpec, not Cucumber.
    See [#212](simplecov-ruby/simplecov#212) (thanks to @ersatzryan and @betelgeuse)
  * MiniTest should now be identified correctly by the command name guesser.
    See [#244](simplecov-ruby/simplecov#244) (thanks to @envygeeks)
  * Makes SimpleCov resilient to inclusion of mathn library.
    See [#175](simplecov-ruby/simplecov#175) and
    [#140](simplecov-ruby/simplecov#140) (thanks to @scotje)
  * Allow coverage_dir to be an absolute path.
  * See [#190](simplecov-ruby/simplecov#190) (thanks to @jshraibman-mdsol)
  * The internal cucumber test suite now uses Capybara 2.
    See [#206](simplecov-ruby/simplecov#206) (thanks to @infertux)
  * Work-arounds for the Coverage library shipped in JRuby 1.6 to behave in line with MRI.
    See [#174](simplecov-ruby/simplecov#174) (thanks to @grddev)
  * Fix warning: instance variable @exit_status not initialized.
    See [#242](simplecov-ruby/simplecov#242) and
    [#213](simplecov-ruby/simplecov#213) (thanks to @sferik and @infertux)

## Bugfixes

  * Correct result calculations for people using :nocov: tags.
    See [#215](simplecov-ruby/simplecov#215) (thanks to @aokolish)
  * Average hits per line for groups of files is now computed correctly.
    See [#192](http://github.com/colszowka/simplecov/pull/192) and
    [#179](http://github.com/colszowka/simplecov/issues/179) (thanks to @Graysonwright)
  * Compatability with BINARY internal encoding.
    See [#194](simplecov-ruby/simplecov#194) and
    [#127](simplecov-ruby/simplecov#127) (thanks to @justfalter)
  * Special characters in `SimpleCov.root` are now correctly escaped before being used as a RegExp.
    See [#204](simplecov-ruby/simplecov#204) and
    [#237](simplecov-ruby/simplecov#237) (thanks to @rli9)
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Mar 17, 2014
v0.8.2, 2013-11-20 ([changes](simplecov-ruby/simplecov@v0.8.1...v0.8.2))
=====================

## Bugfixes

  * Replaced the locking behaviour [via lockfile gem](simplecov-ruby/simplecov#185) with
    plain Ruby explicit file locking when merging results. This should make simplecov merging to behave well
    on Windows again.
    See [#258](simplecov-ruby/simplecov#258) and
    [#223](simplecov-ruby/simplecov#223) (thanks to @tomykaira)

v0.8.1, 2013-11-10 ([changes](simplecov-ruby/simplecov@v0.8.0...v0.8.1))
=====================

## Bugfixes

  * Fixed a regression introduced in 0.8.0 - the Forwardable STDLIB module is now required explicitly.
    See [#256](simplecov-ruby/simplecov#256) (thanks to @kylev)

v0.8.0, 2013-11-10 ([changes](simplecov-ruby/simplecov@v0.7.1...v0.8.0))
=====================

**Note: Yanked the same day because of the regression that 0.8.1 fixes, see above**

## TL;DR

It's been way too long since the last official release 0.7.1, but this was partly due to it proving itself
quite stable in most circumstances. This release brings various further stability improvements to result set merging
(especially when working with parallel_tests), the configuration, source file encodings, and command name guessing.

The 0.8 line is the last one to cooperate with Ruby < 1.9. Starting with 0.9, SimpleCov will assume to be running in
Ruby 1.9+, and will not try to detect or bail silently on older Ruby versions. An appropriate deprecation warning
has been added.

## Features

  * Configuration blocks now have access to variables and methods outside of the block's scope.
    See [#238](simplecov-ruby/simplecov#238) (thanks to @ms-tg)
  * You can now have a global `~/.simplecov` configuration file.
    See [#195](simplecov-ruby/simplecov#195) (thanks to @spagalloco)
  * simplecov-html now uses the MIT-licensed colorbox plugin. Some adjustments when viewing source files,
    including retaining the currently open file on refresh have been added.
    See [simplecov-html #15](simplecov-ruby/simplecov-html#15) (thanks to @chetan)
  * Adds support for Rails 4 command guessing, removes default group `vendor/plugins`.
    See [#181](simplecov-ruby/simplecov#181) and
    [#203](simplecov-ruby/simplecov#203) (thanks to @semanticart and @phallstrom)
  * You can now load simplecov without the default settings by doing `require 'simplecov/no_defaults'`
    or setting `ENV['SIMPLECOV_NO_DEFAULTS']`. Check `simplecov/defaults` to see what preconfigurations are getting
    dropped by using this. See [#209](simplecov-ruby/simplecov#209) (thanks to @ileitch)
  * The result set merging now uses the `lockfile` gem to avoid race conditions.
    See [#185](simplecov-ruby/simplecov#185) (thanks to @jshraibman-mdsol).
  * Automatically detect the usage of parallel_tests and adjust the command name with the test env number accordingly,
    See [#64](simplecov-ruby/simplecov#64) and
    [#185](simplecov-ruby/simplecov#185) (thanks to @jshraibman-mdsol).

## Enhancements

  * Rename adapters to "profiles" given that they are bundles of settings. The old adapter methods are
    deprecated, but remain available for now.
    See [#207](simplecov-ruby/simplecov#207) (thanks to @mikerobe)
  * Tweaks to the automatic test suite naming. In particular, `rspec/features` should now
    be correctly attributed to RSpec, not Cucumber.
    See [#212](simplecov-ruby/simplecov#212) (thanks to @ersatzryan and @betelgeuse)
  * MiniTest should now be identified correctly by the command name guesser.
    See [#244](simplecov-ruby/simplecov#244) (thanks to @envygeeks)
  * Makes SimpleCov resilient to inclusion of mathn library.
    See [#175](simplecov-ruby/simplecov#175) and
    [#140](simplecov-ruby/simplecov#140) (thanks to @scotje)
  * Allow coverage_dir to be an absolute path.
  * See [#190](simplecov-ruby/simplecov#190) (thanks to @jshraibman-mdsol)
  * The internal cucumber test suite now uses Capybara 2.
    See [#206](simplecov-ruby/simplecov#206) (thanks to @infertux)
  * Work-arounds for the Coverage library shipped in JRuby 1.6 to behave in line with MRI.
    See [#174](simplecov-ruby/simplecov#174) (thanks to @grddev)
  * Fix warning: instance variable @exit_status not initialized.
    See [#242](simplecov-ruby/simplecov#242) and
    [#213](simplecov-ruby/simplecov#213) (thanks to @sferik and @infertux)

## Bugfixes

  * Correct result calculations for people using :nocov: tags.
    See [#215](simplecov-ruby/simplecov#215) (thanks to @aokolish)
  * Average hits per line for groups of files is now computed correctly.
    See [#192](http://github.com/colszowka/simplecov/pull/192) and
    [#179](http://github.com/colszowka/simplecov/issues/179) (thanks to @Graysonwright)
  * Compatability with BINARY internal encoding.
    See [#194](simplecov-ruby/simplecov#194) and
    [#127](simplecov-ruby/simplecov#127) (thanks to @justfalter)
  * Special characters in `SimpleCov.root` are now correctly escaped before being used as a RegExp.
    See [#204](simplecov-ruby/simplecov#204) and
    [#237](simplecov-ruby/simplecov#237) (thanks to @rli9)
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Oct 11, 2014
v0.8.2, 2013-11-20 ([changes](simplecov-ruby/simplecov@v0.8.1...v0.8.2))
=====================

## Bugfixes

  * Replaced the locking behaviour [via lockfile gem](simplecov-ruby/simplecov#185) with
    plain Ruby explicit file locking when merging results. This should make simplecov merging to behave well
    on Windows again.
    See [#258](simplecov-ruby/simplecov#258) and
    [#223](simplecov-ruby/simplecov#223) (thanks to @tomykaira)

v0.8.1, 2013-11-10 ([changes](simplecov-ruby/simplecov@v0.8.0...v0.8.1))
=====================

## Bugfixes

  * Fixed a regression introduced in 0.8.0 - the Forwardable STDLIB module is now required explicitly.
    See [#256](simplecov-ruby/simplecov#256) (thanks to @kylev)

v0.8.0, 2013-11-10 ([changes](simplecov-ruby/simplecov@v0.7.1...v0.8.0))
=====================

**Note: Yanked the same day because of the regression that 0.8.1 fixes, see above**

## TL;DR

It's been way too long since the last official release 0.7.1, but this was partly due to it proving itself
quite stable in most circumstances. This release brings various further stability improvements to result set merging
(especially when working with parallel_tests), the configuration, source file encodings, and command name guessing.

The 0.8 line is the last one to cooperate with Ruby < 1.9. Starting with 0.9, SimpleCov will assume to be running in
Ruby 1.9+, and will not try to detect or bail silently on older Ruby versions. An appropriate deprecation warning
has been added.

## Features

  * Configuration blocks now have access to variables and methods outside of the block's scope.
    See [#238](simplecov-ruby/simplecov#238) (thanks to @ms-tg)
  * You can now have a global `~/.simplecov` configuration file.
    See [#195](simplecov-ruby/simplecov#195) (thanks to @spagalloco)
  * simplecov-html now uses the MIT-licensed colorbox plugin. Some adjustments when viewing source files,
    including retaining the currently open file on refresh have been added.
    See [simplecov-html #15](simplecov-ruby/simplecov-html#15) (thanks to @chetan)
  * Adds support for Rails 4 command guessing, removes default group `vendor/plugins`.
    See [#181](simplecov-ruby/simplecov#181) and
    [#203](simplecov-ruby/simplecov#203) (thanks to @semanticart and @phallstrom)
  * You can now load simplecov without the default settings by doing `require 'simplecov/no_defaults'`
    or setting `ENV['SIMPLECOV_NO_DEFAULTS']`. Check `simplecov/defaults` to see what preconfigurations are getting
    dropped by using this. See [#209](simplecov-ruby/simplecov#209) (thanks to @ileitch)
  * The result set merging now uses the `lockfile` gem to avoid race conditions.
    See [#185](simplecov-ruby/simplecov#185) (thanks to @jshraibman-mdsol).
  * Automatically detect the usage of parallel_tests and adjust the command name with the test env number accordingly,
    See [#64](simplecov-ruby/simplecov#64) and
    [#185](simplecov-ruby/simplecov#185) (thanks to @jshraibman-mdsol).

## Enhancements

  * Rename adapters to "profiles" given that they are bundles of settings. The old adapter methods are
    deprecated, but remain available for now.
    See [#207](simplecov-ruby/simplecov#207) (thanks to @mikerobe)
  * Tweaks to the automatic test suite naming. In particular, `rspec/features` should now
    be correctly attributed to RSpec, not Cucumber.
    See [#212](simplecov-ruby/simplecov#212) (thanks to @ersatzryan and @betelgeuse)
  * MiniTest should now be identified correctly by the command name guesser.
    See [#244](simplecov-ruby/simplecov#244) (thanks to @envygeeks)
  * Makes SimpleCov resilient to inclusion of mathn library.
    See [#175](simplecov-ruby/simplecov#175) and
    [#140](simplecov-ruby/simplecov#140) (thanks to @scotje)
  * Allow coverage_dir to be an absolute path.
  * See [#190](simplecov-ruby/simplecov#190) (thanks to @jshraibman-mdsol)
  * The internal cucumber test suite now uses Capybara 2.
    See [#206](simplecov-ruby/simplecov#206) (thanks to @infertux)
  * Work-arounds for the Coverage library shipped in JRuby 1.6 to behave in line with MRI.
    See [#174](simplecov-ruby/simplecov#174) (thanks to @grddev)
  * Fix warning: instance variable @exit_status not initialized.
    See [#242](simplecov-ruby/simplecov#242) and
    [#213](simplecov-ruby/simplecov#213) (thanks to @sferik and @infertux)

## Bugfixes

  * Correct result calculations for people using :nocov: tags.
    See [#215](simplecov-ruby/simplecov#215) (thanks to @aokolish)
  * Average hits per line for groups of files is now computed correctly.
    See [#192](http://github.com/colszowka/simplecov/pull/192) and
    [#179](http://github.com/colszowka/simplecov/issues/179) (thanks to @Graysonwright)
  * Compatability with BINARY internal encoding.
    See [#194](simplecov-ruby/simplecov#194) and
    [#127](simplecov-ruby/simplecov#127) (thanks to @justfalter)
  * Special characters in `SimpleCov.root` are now correctly escaped before being used as a RegExp.
    See [#204](simplecov-ruby/simplecov#204) and
    [#237](simplecov-ruby/simplecov#237) (thanks to @rli9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants