jasmine / jasmine-gem

Jasmine ruby gem
682 stars 275 forks source link

Spec option #251

Closed hwayne closed 8 years ago

hwayne commented 9 years ago

At my company we had so many jasmine specs that they'd take 20+ seconds to load before the test runner even started. For our recent hackathon I sketched up spec option, so you can do rake jasmine:ci spec=foo/bar/blat_spec.js to only load and run the specs you want to. This has made it a lot easier for us to BDD with jasmine, since instead of running a few thousand specs in a minute we just do six in a few seconds.

I checked the gem and saw issue #234 and figured it'd be good to throw this up as a PR. I don't think it's master-ready yet - it is a hackathon project, after all. But it might make a good launching point for developing the feature. Let's chat revisions!

hwayne commented 9 years ago

Some notes on the implementation that may or may not be acceptable:

slackersoft commented 9 years ago

Thanks for taking a look at this feature. This looks pretty good for a first pass. I would like to see a couple of updates before we merge.

Also, I'm a bit concerned about having both test_files and spec_files attributes on the Config object as it could lead to confusion about which is which. It might make sense to find a better name for the combined list (helpers and specs) and just plumb that name change through.

hwayne commented 8 years ago

Wow, hugely sorry for how long that took to update. Made both changes as requested. Wrt the spec_files versus test_files, what about changing spec_files to all_loaded_files? That makes it clear it's everything. Happy to add that in if you want to make that change.

slackersoft commented 8 years ago

That sounds good. Let's go with all_loaded_files for now. Thanks

hwayne commented 8 years ago

Quick question before pushing: Do you think having all_loaded_files would confuse people, given it doesn't include src_files and css_files?

slackersoft commented 8 years ago

Hmmm, maybe testing_files or something.

hwayne commented 8 years ago

So I tried making the change, but I ran into a problem with this line. I think the variable name and the symbol should be the same for consistency's sake, but as far as I can tell the symbol determines the name of the directory jasmine looks in. I think any refactoring I could do around this would be fairly complex and it might be worth talking that through in its own diff. What are your thoughts?

slackersoft commented 8 years ago

For now, let's just stop there and leave the symbol so the urls are still /spec but pass in all of the testing_files

hwayne commented 8 years ago

Got it passing!