generative icon indicating copy to clipboard operation
generative copied to clipboard

generative does nothing unless GENERATIVE_COUNT is set

Open jessitron opened this issue 11 years ago • 8 comments

I'm using rspec 2.

The generative tests operate like any other "describe" unless I set the GENERATIVE_COUNT environment variable. This is inconsistent with the README.

jessitron avatar Jan 13 '14 03:01 jessitron

The goal was to only set the env var during a Rake RSpec task that you specifically want to use generative with, since RSpec 2 does not support separate orderings. Are you using the Rakefile example from the README? I'd love to get it updated to be correct/clearer.

justincampbell avatar Jan 15 '14 15:01 justincampbell

I'm not using rake. The read me could say that if you run rspec directly, set the env var.

On Wednesday, January 15, 2014, Justin Campbell wrote:

The goal was to only set the env var during a Rake RSpec task that you specifically want to use generative with, since RSpec 2 does not support separate orderings. Are you using the Rakefile example from the README? I'd love to get it updated to be correct/clearer.

— Reply to this email directly or view it on GitHubhttps://github.com/justincampbell/generative/issues/5#issuecomment-32370656 .

jessitron avatar Jan 15 '14 16:01 jessitron

During my talk on Monday, I noticed that when I set GENERATIVE_COUNT, rspec runs -all- my tests that many times. If the env var is controlling this, then that makes sense.

jessitron avatar Jan 15 '14 16:01 jessitron

@jessitron Could you try the command-and-rake-task branch? I think this solves many of those issues.

justincampbell avatar Jan 17 '14 21:01 justincampbell

OK! Will do this weekend

On Fri, Jan 17, 2014 at 3:31 PM, Justin Campbell [email protected]:

@jessitron https://github.com/jessitron Could you try the command-and-rake-task branch? I think this solves many of those issues.

— Reply to this email directly or view it on GitHubhttps://github.com/justincampbell/generative/issues/5#issuecomment-32650188 .

jessitron avatar Jan 17 '14 21:01 jessitron

@justincampbell I can confirm this has been fixed since command-and-rake-task has been merged. See https://github.com/levionessa/rb-fizzbuzz/blob/master/spec/fizz_buzz_spec.rb. I through a binding.pry into the example based test and it only executed once.

nessamurmur avatar Oct 10 '14 16:10 nessamurmur

Err... correction, the latter issue of setting GENERATIVE_COUNT and it running all the tests that many times. The initial issue of having to set the environment variable still stands when running rspec instead of the rake task.

Would it make sense to just change the default here to 100 or something?

nessamurmur avatar Oct 10 '14 16:10 nessamurmur

Realized defaulting to 1 is also enabling generative to not run non-generative tests the correct number of times...

nessamurmur avatar Oct 10 '14 16:10 nessamurmur