On Sunday, March 20, 2016 at 7:50:16 PM UTC-7, Myron Marston wrote:
>
> Thanks for letting us know what you figured out, Robb!
>
Sure, you're welcome. Could you tell me, if it's possible to do this purely
using the rspec library; that is, without shelling out?
Here's my working code:
def self.run_spec(source_code)
stdin, stdout, stderr = Open3.popen3('ruby -rrspec/autorun - --format
json')
stdin.puts source_code
stdin.close
output = stdout.gets
raise "Error running rspec: #{stderr.gets}" if output.nil?
JSON.parse(output)
end
--
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/8f5e8c8c-6603-40d4-83bb-71ee78dc8432%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.