From 4d26b3c8212bad271950c945e4f41108b85addfc Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 17 May 2011 10:53:54 -0400 Subject: [PATCH] add a bunch of pretty stuff --- index.md | 49 ++++++++++++++++++++++++++++++++++++++++++ sass/screen.scss | 4 ++-- stylesheets/screen.css | 12 +++++------ 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/index.md b/index.md index d917918..25255c1 100644 --- a/index.md +++ b/index.md @@ -93,6 +93,38 @@ does not support out of the box. Once there's official support, you'll be able t and the Jasmine test server when you're using CoffeeScript. CoffeeScript files are compiled and injected into the generated HTML files. +Never done Jasmine in CoffeeScript? It looks like this: + +{% highlight coffeescript %} +describe 'Component', -> + describe 'StorylineNode', -> + model = null + + beforeEach -> + model = new ComponentStorylineNode({id: 1}) + + it 'should not be new', -> + expect(model.isNew()).toEqual(false) +{% endhighlight %} + +...and it turns into this... + +{% highlight js %} +describe('Component', function() { + return describe('StorylineNode', function() { + var model; + model = null; + beforeEach(function() { + return model = new ComponentStorylineNode({ + id: 1 + }); + }); + return it('should not be new', function() { + return expect(model.isNew()).toEqual(false); + }); + }); +}); +{% endhighlight %} #### Server interaction Since there's no Jasmine server running, there's no way to grab test files from the filesystem via Ajax. @@ -192,6 +224,23 @@ Jasmine::Headless::Task.new('jasmine:headless') do |t| end {% endhighlight %} +If you've bundled `jasmine-headless-webkit` in with Rails, you'll also get a basic task for running your +Jasmine specs. Be sure to include the gem in the development group so you get with a normal call to `rake -T`: + +{% highlight ruby %} +group :test, :development do + gem 'jasmine-headless-webkit' +end +{% endhighlight %} + +
+# rake -T
+
+rake jasmine:headless     # Run Jasmine specs headlessly
+
+ +This is the same as running `jasmine-headless-webkit -c`. + ## I have a problem or helpful suggestion, good sir. Here's what you can do: diff --git a/sass/screen.scss b/sass/screen.scss index 7bf331e..891484f 100644 --- a/sass/screen.scss +++ b/sass/screen.scss @@ -77,12 +77,12 @@ body { } } - .js, .ruby { + .js, .ruby, .coffeescript { .nx { color: $indicator-code-color; } - .s1 { + .s1, .ss { color: $scalar-code-color; } diff --git a/stylesheets/screen.css b/stylesheets/screen.css index 16dfac1..f8f53f3 100644 --- a/stylesheets/screen.css +++ b/stylesheets/screen.css @@ -89,26 +89,26 @@ body #container #inner-container .yaml .p-Indicator { color: #78a39d; } /* line 81, ../sass/screen.scss */ -body #container #inner-container .js .nx, body #container #inner-container .ruby .nx { +body #container #inner-container .js .nx, body #container #inner-container .ruby .nx, body #container #inner-container .coffeescript .nx { color: #78a39d; } /* line 85, ../sass/screen.scss */ -body #container #inner-container .js .s1, body #container #inner-container .ruby .s1 { +body #container #inner-container .js .s1, body #container #inner-container .js .ss, body #container #inner-container .ruby .s1, body #container #inner-container .ruby .ss, body #container #inner-container .coffeescript .s1, body #container #inner-container .coffeescript .ss { color: #e68917; } /* line 89, ../sass/screen.scss */ -body #container #inner-container .js .nb, body #container #inner-container .ruby .nb { +body #container #inner-container .js .nb, body #container #inner-container .ruby .nb, body #container #inner-container .coffeescript .nb { color: #abb592; } /* line 93, ../sass/screen.scss */ -body #container #inner-container .js .kc, body #container #inner-container .js .kp, body #container #inner-container .ruby .kc, body #container #inner-container .ruby .kp { +body #container #inner-container .js .kc, body #container #inner-container .js .kp, body #container #inner-container .ruby .kc, body #container #inner-container .ruby .kp, body #container #inner-container .coffeescript .kc, body #container #inner-container .coffeescript .kp { color: #a7b585; } /* line 97, ../sass/screen.scss */ -body #container #inner-container .js .no, body #container #inner-container .ruby .no { +body #container #inner-container .js .no, body #container #inner-container .ruby .no, body #container #inner-container .coffeescript .no { color: #de1629; } /* line 101, ../sass/screen.scss */ -body #container #inner-container .js .n, body #container #inner-container .ruby .n { +body #container #inner-container .js .n, body #container #inner-container .ruby .n, body #container #inner-container .coffeescript .n { color: #cef56b; }