Closed mooreniemi closed 9 years ago
Are you using rspec-console with irb-config?
No, irb-config caused issues for me, so I removed it. I also can't guarantee it will be used by the rest of my department, whereas rspec-console's use is widespread. Would irb-config have fixed this somehow?
No I though AR's logger was always going in log/test.log
, except with irb-config which plugs STDERR to the logger: https://github.com/nviennot/irb-config/blob/master/irb/rails_colors.rb#L6
I changed your code to use some more idiomatic ruby: https://github.com/nviennot/rspec-console/blob/silence_ar/lib/rspec-console/pry.rb
Can you try the silence_ar branch and see if it works for you?
Confirmed to work for me.
pushed to master :)
Thanks! :+1:
btw I forced push on master to fix the test you wrote :)
While using
rspec-console
in Rails, the ActiveRecord logging to console output can obscure the test output. (If you have a noisy database.) My code changes allow a user to set an environment variable to silence the log while running tests inrails c test
. I'd like to put more tests around the Pry command itself, but I can confirm this command works in my apps (mix of jruby, Ruby 2, Rails 3 and 4).All other changes are "boyscout rule" changes in response to deprecation warnings.