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

Incompatible with colored gem #237

Open
vishnun opened this issue Jul 7, 2017 · 0 comments
Open

Incompatible with colored gem #237

vishnun opened this issue Jul 7, 2017 · 0 comments

Comments

@vishnun
Copy link

vishnun commented Jul 7, 2017

Konacha uses colorize gem as a dependency to color the "dots" to indicate the tests.

Where: /konacha-4.0.0/lib/konacha/formatter.rb
The colorize method is in conflict with the colorize method in the colored gem.

I've raised an issue with the colorize gem as well : fazibear/colorize#60
If you can work something out with the developers of that gem or if you can try to use some other gem for coloring? or anything that will resolve this conflict.

It'll be very helpful and we won't have to switch to another testing framework due to this.

Thanks.

----- For people facing this issue, here's a temporary work around. -------
To resolve the incompatibility, the only way for now is to monkey patch the Konacha formatter to disable coloring:

 # Monkey patch to get around the colored - colorize gem incompatibility. Disabling colors for konacha
module Konacha
  class Formatter
    def color_enabled?
      false
    end
    
    private
    def failure_message(example)
      msg = []
      msg << "  Failed: #{example.full_description}"
      msg << "    #{example.exception.message}"
      msg << "    in #{example.exception.backtrace.first}" if example.exception.backtrace.present?
      msg.join("\n")
    end
  end
end

Putting this at the top of the initializer works for now.

vishnun added a commit to vishnun/konacha that referenced this issue Jul 7, 2017
… with colored gem which is a dependency for other gem.
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

No branches or pull requests

1 participant