Hi Robb What are you trying to achieve with this? I might be able to find you a way to do this without using private APIs / interfering with the RSpec internals.
Cheers Jon Rowe --------------------------- [email protected] jonrowe.co.uk On Monday, 25 January 2016 at 02:49, Allen Madsen wrote: > I don't understand why you're modifying stuff through non-public > interfaces. Is there a reason you can't use > `config.default_formatter=`? > > http://www.rubydoc.info/gems/rspec-core/RSpec/Core/Configuration#default_formatter%3D-instance_method > Allen Madsen > http://www.allenmadsen.com > > > On Sun, Jan 24, 2016 at 4:32 AM, Robb Shecter <[email protected] > (mailto:[email protected])> wrote: > > Yes, the interfaces here in RSpec 3 have changed. I found a good answer on > > Stack Overflow. It does use this mysterious code, though: > > > > # internal hack > > # api may not be stable, make sure lock down Rspec version > > loader = config.send(:formatter_loader) > > notifications = loader.send(:notifications_for, > > RSpec::Core::Formatters::JsonFormatter) > > > > reporter.register_listener(formatter, *notifications) > > > > > > I'm not sure what that's about. > > > > -- > > You received this message because you are subscribed to the Google Groups > > "rspec" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to [email protected] > > (mailto:[email protected]). > > To post to this group, send email to [email protected] > > (mailto:[email protected]). > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/rspec/52a47979-6502-41c9-bccf-1602e36aa4d3%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "rspec" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > To view this discussion on the web visit > https://groups.google.com/d/msgid/rspec/CAK-y3CtoNJUDvrJ8A_yPR4nZx0gvLS%3DHVXgXkHt0Dq6MpXv%3D%3DA%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. > > -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/D92357A4F2B64433B1A154F8D858EA7D%40jonrowe.co.uk. For more options, visit https://groups.google.com/d/optout.
