updates and fixes for liquid 2.2.2

This commit is contained in:
John Bintz 2011-10-24 11:18:39 -04:00
parent cb0f8b816e
commit 212397dc9e
5 changed files with 61 additions and 54 deletions

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
.sass-cache/ .sass-cache/
_site/ _site/
.idea/* .idea/*
.jhw-cache/
ext/
pkg/

3
Gemfile Normal file
View File

@ -0,0 +1,3 @@
gem 'jekyll'
gem 'liquid', '2.2.2'
gem 'redcarpet'

View File

@ -1,60 +1,30 @@
PATH
remote: .
specs:
jasmine-headless-webkit (0.1.1)
coffee-script
jasmine
rainbow
GEM GEM
remote: http://rubygems.org/
specs: specs:
ZenTest (4.5.0) albino (1.3.3)
autotest (4.4.6) posix-spawn (>= 0.3.6)
ZenTest (>= 4.4.1) classifier (1.3.3)
childprocess (0.1.8) fast-stemmer (>= 1.0.0)
ffi (~> 1.0.6) directory_watcher (1.4.1)
coffee-script (2.2.0) fast-stemmer (1.0.0)
coffee-script-source jekyll (0.11.0)
execjs albino (>= 1.3.2)
coffee-script-source (1.1.0) classifier (>= 1.3.1)
diff-lcs (1.1.2) directory_watcher (>= 1.1.1)
execjs (0.3.3) kramdown (>= 0.13.2)
multi_json (~> 1.0) liquid (>= 1.9.0)
fakefs (0.3.2) maruku (>= 0.5.9)
ffi (1.0.7) kramdown (0.13.3)
rake (>= 0.8.7) liquid (2.2.2)
jasmine (1.0.2.0) maruku (0.6.0)
coffee-script-source syntax (>= 1.0.0)
json_pure (>= 1.4.3) posix-spawn (0.3.6)
rack (>= 1.1) redcarpet (1.17.2)
rspec (>= 1.3.1) syntax (1.0.0)
selenium-webdriver (>= 0.1.3)
json_pure (1.5.1)
multi_json (1.0.1)
rack (1.2.2)
rainbow (1.1.1)
rake (0.8.7)
rspec (2.5.0)
rspec-core (~> 2.5.0)
rspec-expectations (~> 2.5.0)
rspec-mocks (~> 2.5.0)
rspec-core (2.5.1)
rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.5.0)
rubyzip (0.9.4)
selenium-webdriver (0.2.0)
childprocess (>= 0.1.7)
ffi (>= 1.0.7)
json_pure
rubyzip
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
autotest jekyll
fakefs liquid (= 2.2.2)
jasmine-headless-webkit! redcarpet
rspec

View File

@ -1,4 +1,4 @@
markdown: rdiscount markdown: redcarpet
auto: true auto: true
server: true server: true
pygments: true pygments: true

View File

@ -225,6 +225,20 @@ If you need to test server interaction, do one of the following:
* Stub your server responses using [Sinon.JS](http://sinonjs.org/), the recommended way. * Stub your server responses using [Sinon.JS](http://sinonjs.org/), the recommended way.
* Use [PhantomJS](http://www.phantomjs.org/) against a running copy of a Jasmine server, instead of this project. * Use [PhantomJS](http://www.phantomjs.org/) against a running copy of a Jasmine server, instead of this project.
#### Vendored JavaScript support
_(still in development!)_
You can pull in vendored JavaScript files as helpers in your setup! Add the `vendored_helpers` section to your `jasmine.yml` file
with the names of some helpers you want to use (take a look at [jasmine-spec-extras](https://github.com/johnbintz/jasmine-spec-extras) to see how it works):
{% highlight yaml %}
vendored_helpers:
- 'sinon'
{% endhighlight %}
_This is the first step in an effort to intergrate with Sprockets directly to make testing modern Rails apps as seamless as possible. Oh yeah, it's coming!_
#### What else works? #### What else works?
`alert()` and `confirm()` work, though the latter always returns `true`. You should be mocking calls to `confirm()`, `alert()` and `confirm()` work, though the latter always returns `true`. You should be mocking calls to `confirm()`,
@ -244,6 +258,9 @@ spyOn(window, 'confirm').andReturn(false)
If you need a heavy-weight object printer, you also have `console.pp()`, which uses Jasmine's built-in pretty-printer if available, and falls back to `JSON.stringify()` if it's not. If you need a heavy-weight object printer, you also have `console.pp()`, which uses Jasmine's built-in pretty-printer if available, and falls back to `JSON.stringify()` if it's not.
You also get an additional method, `console.peek()`, which calls `console.log()` with the provided parameter, then passes the parameter back along so you
can continue to work with it. It's the equivalent of `.tap { |o| p o }` in Ruby.
## Running the runner ## Running the runner
{% highlight bash %} {% highlight bash %}
@ -253,6 +270,7 @@ jasmine-headless-webkit [ -c / --colors ]
[ --keep ] [ --keep ]
[ -l / --list ] [ -l / --list ]
[ --report <report file> ] [ --report <report file> ]
[ --runner-out <html file> ]
[ -j / --jasmine-config <path to jasmine.yml> ] [ -j / --jasmine-config <path to jasmine.yml> ]
<spec files to run> <spec files to run>
{% endhighlight %} {% endhighlight %}
@ -332,6 +350,18 @@ valuable seconds off of testing with every run, saving you enough time every day
If you don't want this behavior, pass in `--no-full-run` and filtered runs will be the only thing that runs when you request one. If you don't want this behavior, pass in `--no-full-run` and filtered runs will be the only thing that runs when you request one.
### Writing the HTML runner to another location
If you want to use the runner file in other places, use the `--runner-out` parameter with the name of the target file.
The HTML produced uses the Jasmine `HtmlReporter` if not loaded in `jasmine-headless-webkit`, so you should be able
to just open it in a browser and have it work.
If you always want the reporter written to a particular location, you can define that location in `jasmine.yml`:
{% highlight yaml %}
runner_output: "runner.html"
{% endhighlight %}
## Running the runner from a Ruby program ## Running the runner from a Ruby program
You can call the runner from Ruby: You can call the runner from Ruby: