I am creating a test automation tool that runs a rspec test from within 
ruby, not from command line.

I run my test like this that runs and gives me a output hash with pass / 
fail etc.

config = RSpec.configuration

json_formatter = RSpec::Core::Formatters::JsonFormatter.new(config.out)
reporter =  RSpec::Core::Reporter.new(json_formatter)
config.instance_variable_set(:@reporter, reporter)
RSpec::Core::Runner.run(["#{Rails.root}/spec/test1_spec.rb"])

puts json_formatter.output_hash 

All is great until i run it again and i get the error

> undefined method `visit' for 
> #<RSpec::Core::ExampleGroup::Nested_7:0x007ff3d343d978>

how do i reload / make sure all spec_helper and files are loaded before i 
run it again ?

thanks Rick

-- 
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/8fa924ac-3bc9-45ef-b34e-b8a9017c7681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to