Is there a possibility to create a reporter where we get also more information about passed test? What I want is to show which except’s has been executed with which results.
You could do that. Create a custom formatter that tracks the information you want and reports it however you want (e.g. to stdout or CouchDB or whatever). Our docs show how to define one and list all the events you can subscribe to. It sounds like you want this formatter to be in addition to a normal one (rather than replacing it), so be sure to call config.add_formatter twice — once with your normal output formatter, and once with your custom one.
Note that there are no events for each individual expectation. You’ll have to extend RSpec a bit to do that. It’s not too bad, though:
module ExtendExpect
def expect(*args, &block)
# put whatever custom logic around `expect` you want. e.g. you could notify your custom formatter from here
super
end
end
RSpec.configure do |c|
c.include ExtendExpect
end
HTH,
Myron
--
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 rspec+unsubscribe@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/39fc23b5-b721-478c-9ef8-df60d1c89297%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Is there a possibility to create a reporter where we get also more information about passed test? What I want is to show which except’s has been executed with which results.
You could do that. Create a custom formatter that tracks the information you want and reports it however you want (e.g. to stdout or CouchDB or whatever). Our docs show how to define one and list all the events you can subscribe to. It sounds like you want this formatter to be in addition to a normal one (rather than replacing it), so be sure to call
config.add_formattertwice — once with your normal output formatter, and once with your custom one.Note that there are no events for each individual expectation. You’ll have to extend RSpec a bit to do that. It’s not too bad, though:
module ExtendExpect def expect(*args, &block) # put whatever custom logic around `expect` you want. e.g. you could notify your custom formatter from here super end end RSpec.configure do |c| c.include ExtendExpect endHTH,
Myron
On Fri, Jan 5, 2018 at 5:24 AM, Attila Strba <attila...@esrlabs.com> wrote:
Hi Guys,we are trying to use RSpec for our Integration and System testing. Just a short overview of our test framework to give some background regarding my question. We have a various Hardware hooked up to Jenkins clients which we control over Ruby and control the test execution/test logic currently in Minitest. The results of the test execution are beeing pushed to a CouchDB. We want to move away from Minitest due to it's limitation for this use case like: no support for test suites, dependent tests, random execution order etc. Rspec seems to have all the features we need. There is one point missing though, and that is my question:Is there a possibility to create a reporter where we get also more information about passed test? What I want is to show which except's has been executed with which results.Thank you in advance for any help.greetingsAttila
--
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 rspec+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+unsubscribe@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/92844eb1-c636-4dd0-8edd-374b9d64edd5%40googlegroups.com.