`RSpec.describe` is just Ruby and takes a block describing specs, what I think 
will work for you is something like (obviously slightly pseudo code):

```
output = StringIO.new('', 'w')

RSpec.configure do |rspec|
  rspec.default_formatter = 'json'
end


[things, to, spec].each do |item|
  RSpec.describe item.description do
    item.checks.each do |spec|
      it spec.title, &spec.test_block
    end
  end
end

exist_status = RSpec::Core::Runner.run([], $stderr, output)
```


Cheers
Jon Rowe
---------------------------
[email protected]
jonrowe.co.uk


On Monday, 15 February 2016 at 13:14, Robb Shecter wrote:

> On Saturday, February 13, 2016 at 3:20:01 PM UTC-8, Jon Rowe wrote:
> > ...if you’re creating the specs inside Ruby have you considered creating 
> > them programatically rather than writing them to files?
>  
> Absolutely! That's what I'd like to do, but I haven't been able to figure out 
> how from the API, 
> http://www.rubydoc.info/github/rspec/rspec-core/RSpec/Core/Runner. I haven't 
> seen documentation for doing this, or do you know of some?  
>  
> --  
> 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/fe3e8f22-0763-48dc-87e8-9edf11829507%40googlegroups.com
>  
> (https://groups.google.com/d/msgid/rspec/fe3e8f22-0763-48dc-87e8-9edf11829507%40googlegroups.com?utm_medium=email&utm_source=footer).
> 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/FBB04D04154D4C8596E38E6DE6568DBB%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to