No commit activity in last 3 years
No release in over 3 years
A noisy warnings suppressor for capybara/poltergeist. This gem silences noisy phantomjs warnings such as 'CoreText performance note...'.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Poltergeist::Suppressor

A noisy warnings suppressor for capybara/poltergeist.

This gem silences noisy phantomjs warnings such as 'CoreText performance note...'.

Example before using:

% rspec ./spec/example_spec.rb
2014-05-01 05:26:27.380 phantomjs[92529:507] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
2014-05-01 05:26:27.927 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Helvetica Neue" and got font with PostScript name "HelveticaNeue". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:27.927 phantomjs[92529:507] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
2014-05-01 05:26:27.931 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:27.932 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:27.934 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:27.934 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:27.935 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:28.184 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:28.184 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:28.184 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Lucida Grande" and got font with PostScript name "LucidaGrande". For best performance, only use PostScript names when calling this API.
2014-05-01 05:26:28.470 phantomjs[92529:507] CoreText performance note: Client called CTFontCreateWithName() using name "Helvetica Neue" and got font with PostScript name "HelveticaNeue". For best performance, only use PostScript names when calling this API.
.

Finished in 3.7 seconds
1 example, 0 failures

After:

% rspec ./spec/example_spec.rb
.

Finished in 3.7 seconds
1 example, 0 failures

Installation

Add this line to your application's Gemfile:

gem 'poltergeist-suppressor'

And then execute:

$ bundle

Or install it yourself as:

$ gem install poltergeist-suppressor

Usage

Add these lines to spec_helper.rb:

require 'capybara/poltergeist'
require 'poltergeist/suppressor'

This gem automatically set a suppressed driver to :poltergeist.

You can manually add a suppressor to your driver.

Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app,
    phantomjs_logger: Capybara::Poltergeist::Suppressor.new
  )
end

And you can specify ignore patterns in regexp.

suppressor = Capybara::Poltergeist::Suppressor.new(patterns: [
  /spam spam spam spam/,
  /spamspamspamspam/
])

Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app, phantomjs_logger: suppressor)
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request