From b8c5e3fe88c2a726199a6aabd3f66aeb43cc7ac0 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 22 Nov 2011 14:38:16 -0500 Subject: [PATCH] readme --- README.md | 45 +++++++++------------------------------------ 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 690d41b..5928d0b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ Use vendored Jasmine helpers! No more copying around all those fun helpers to all your projects! -Works with Rails gems like jquery-rails too! -Works in jasmine-headless-webkit versions after October 16, 2011. Whoa! +Works in jasmine-headless-webkit versions that support Sprockets. ## What it comes with... @@ -12,45 +11,19 @@ It comes with the libraries I need: ## How to use it -Add a `vendored_helpers` section to your `jasmine.yml` file: +It's Sprockets vendored gem goodness, so at the top of your `spec_helper`: -``` yaml -vendored_helpers: -- 'sinon' -- 'jasmine-jquery' +``` coffee +#= require jasmine-jquery +#= require sinon + +...make cool code... ``` -### ...and Rails asset gems, too? - -Sure, this just looks for files in gems in the path `vendor/assets/javascripts/#{name}.js`. So if you want -to include jQuery from `jquery-rails`: - -``` yaml -vendored_helpers: -- 'jquery' -``` - -Easy! - -## Support in stock Jasmine yet? - -Not yet, want to see how well this works first. - ## Why? -Two reasons: - -* Part of the problem with testing modern Rails apps is the use of JavaScript bundled in gems, specifically in - the `vendor/assets/javascripts` folder of the gems that provide them. Normally, one uses a Railtie to find - out what provides those files, but you can also do it the slow way and look at all loaded gems for that - directory. Recent versions (on GitHub) of jasmine-headless-webkit support loading those vendored files. - -* I got sick of copying jasmine-jquery and sinon to all my projects. Now with one gem, they're all available. It also - makes it easier to copy around your own JS stuff. - -## How do I do this myself? I don't care if it's super-slow finding all the files. - -Look at https://github.com/johnbintz/jasmine-headless-webkit/blob/master/lib/jasmine/files_list.rb#L162 +I got sick of copying jasmine-jquery and sinon to all my projects. Now with one gem, they're all available. It also +makes it easier to copy around your own JS stuff. ## Warnings from the bleeding edge