GithubHelp home page GithubHelp logo

guard / guard-jasmine Goto Github PK

View Code? Open in Web Editor NEW
304.0 304.0 81.0 1.29 MB

The Swiss Army knife for automated Jasmine specs in your console.

Home Page: http://guard.github.io/guard-jasmine

License: MIT License

Emacs Lisp 0.12% Ruby 88.12% JavaScript 6.03% CoffeeScript 5.73%

guard-jasmine's Introduction

Guard

Gem Version Build Status Code Climate Test Coverage Inline docs Reviewed by Hound

Guard Icon

Guard automates various tasks by running custom rules whenever file or directories are modified.

It's frequently used by software developers, web designers, writers and other specialists to avoid mundane, repetitive actions and commands such as "relaunching" tools after changing source files or configurations.

Common use cases include: an IDE replacement, web development tools, designing "smart" and "responsive" build systems/workflows, automating various project tasks and installing/monitoring various system services.

For a full categorized list of known Guard plugins, look here: https://github.com/guard/guard/wiki/Guard-Plugins

If you have any questions about Guard or want to share some information with the Guard community, please go to one of the following places:

Before you file an issue, make sure you have read the known issues and file an issue sections that contains some important information.

Features

  • File system changes handled by our awesome Listen gem.
  • Support for visual system notifications.
  • Huge eco-system with more than 300 Guard plugins.
  • Tested against the latest Ruby 2.4.x, 2.5.x, 2.6.x, JRuby & Rubinius. See .travis-ci.yml for the exact versions.

Screencast

Two nice screencasts are available to help you get started:

Installation

The simplest way to install Guard is to use Bundler.

Add Guard (and any other dependencies) to a Gemfile in your project’s root:

group :development do
  gem 'guard'
end

then install it by running Bundler:

$ bundle

Generate an empty Guardfile with:

$ bundle exec guard init

Run Guard through Bundler with:

$ bundle exec guard

If you are on Mac OS X and have problems with either Guard not reacting to file changes or Pry behaving strange, then you should add proper Readline support to Ruby on macOS.

Avoiding gem/dependency problems

It's important that you always run Guard through Bundler to avoid errors.

If you're getting sick of typing bundle exec all the time, try one of the following:

  • (Recommended) Running bundle binstub guard will create bin/guard in your project, which means running bin/guard (tab completion will save you a key stroke or two) will have the exact same result as bundle exec guard.

  • Or, you can alias be="bundle exec" in your .bashrc or similar and the execute only be guard. Protip: It will work for all comands executed in bundle exec context!

  • Or, for RubyGems >= 2.2.0 (at least, though the more recent the better), simply set the RUBYGEMS_GEMDEPS environment variable to - (for autodetecting the Gemfile in the current or parent directories) or set it to the path of your Gemfile.

(To upgrade RubyGems from RVM, use the rvm rubygems command).

NOTE: this Rubygems feature is still under development still lacks many features of bundler

Add Guard plugins

Guard is now ready to use and you should add some Guard plugins for your specific use. Start exploring the many Guard plugins available by browsing the Guard organization on GitHub or by searching for guard- on RubyGems.

When you have found a Guard plugin of your interest, add it to your Gemfile:

group :development do
  gem '<guard-plugin-name>'
end

See the init section of the Guard usage below to see how to install the supplied plugin template that you can install and to suit your needs.

Usage

Guard is run from the command line. Please open your terminal and go to your project work directory.

Look here for a full list of Guard commands

Start

Just launch Guard inside your Ruby or Rails project with:

$ bundle exec guard

Guard will look for a Guardfile or guardfile.rb in your current directory. If it does not find one, it will look in your $HOME directory for a .Guardfile.

Please look here to see all the command line options for Guard

Interactions

Please read how to interact with Guard on the console and which signals Guard accepts

Guardfile DSL

For details on extending your Guardfile look at Guardfile examples or look at a list of commands Guardfile-DSL / Configuring-Guard

Issues

Before reporting a problem, please read how to File an issue.

Development / Contributing

See the Contributing Guide.

Releasing

Prerequisites

  • You must have commit rights to the GitHub repository.
  • You must have push rights for rubygems.org.

How to release

  1. Determine which would be the correct next version number according to semver.
  2. Update the version in ./lib/guard/version.rb.
  3. Commit the version in a single commit, the message should be "Bump VERSION to X.Y.Z".
  4. Push and open a pull request.
  5. Once CI is green, merge the pull request.
  6. Pull the changes locally and run bundle exec rake release:full; this will tag, push to GitHub, publish to rubygems.org, and publish the release notes .

Author

Thibaud Guillaume-Gentil (@thibaudgg)

Core Team

Contributors

https://github.com/guard/guard/graphs/contributors

guard-jasmine's People

Contributors

adamstrickland avatar arr-ee avatar clumsysnake avatar darrinholst avatar dawidjanczak avatar dnagir avatar douwem avatar e2 avatar esposito avatar eventualbuddha avatar gonzedge avatar jorgemanrubia avatar juanger avatar koffeinfrei avatar matstc avatar michaelcarter avatar mkdynamic avatar mortonfox avatar nathanstitt avatar neilgupta avatar netzpirat avatar nfm avatar pjurczynski avatar readmecritic avatar ronen avatar rud avatar rymai avatar swistak avatar taavo avatar twill88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guard-jasmine's Issues

Add a custom console function

This would enable us to give the developer the possibility to define a toString() method and use the JSON lib for pretty print the objects. In addition, warn, error, info could be implemented.

Jasmine fired when the spec file does not exist

The following error happens when I create a new js file but there is no corresponding spec file created yet.

Run Jasmine suite spec/javascripts/viewss/listings-limit-exceeded-view-spec.js
ERROR: Guard::Jasmine failed to achieve its <run_on_change>, exception was:
Errno::ENOENT: No such file or directory - spec/javascripts/viewss/listings-limit-exceeded-view-spec.js
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:139:in foreach' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:139:inquery_string_for_suite'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:112:in jasmine_suite' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:88:inrun_jasmine_spec'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:37:in run' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine.rb:136:ininject'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:36:in each' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:36:ininject'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine/runner.rb:36:in run' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-jasmine-1.1.3/lib/guard/jasmine.rb:136:inrun_on_change'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:395:in send' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:395:inrun_supervised_task'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:393:in catch' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:393:inrun_supervised_task'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:349:in run_on_change_task' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:287:inrun_on_change'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:327:in run_on_guards' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:326:ineach'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:326:in run_on_guards' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:325:incatch'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:325:in run_on_guards' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:324:ineach'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:324:in run_on_guards' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:286:inrun_on_change'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:303:in run' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:300:insynchronize'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:300:in run' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard.rb:285:inrun_on_change'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard/listener.rb:235:in start_reactor' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard/listener.rb:231:inloop'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard/listener.rb:231:in start_reactor' /Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard/listener.rb:230:ininitialize'
/Users/huy/.rvm/gems/ree-1.8.7-2012.02@customer-platform/gems/guard-1.0.2/lib/guard/listener.rb:230

Guard::Jasmine has just been fired

Can't open ... guard-jasmine.coffee

Hi,

I am using ubuntu 12.10, phantomjs 1.6.0-5ubuntu1 and guard-jasmine 1.8.1 and when I try to start guard I get the following error:

Guard::Jasmine starts webrick test server on port 8888 in development environment.
Waiting for Jasmine test runner at http://localhost:8888/jasmine
Run all Jasmine suites
Run Jasmine suite at http://localhost:8888/jasmine
Can't open '/home/blag/.rvm/gems/ruby-1.9.3-p194/gems/guard-jasmine-1.8.1/lib/guard/jasmine/phantomjs/guard-jasmine.coffee'
ERROR: No response from the Jasmine runner!

After some research on the internet I also tried the following:

$ phantomjs /home/blah/.rvm/gems/ruby-1.9.3-p194/gems/guard-jasmine-1.8.1/lib/guard/jasmine/phantomjs/guard-jasmine.coffee 
Can't open '/home/blah/.rvm/gems/ruby-1.9.3-p194/gems/guard-jasmine-1.8.1/lib/guard/jasmine/phantomjs/guard-jasmine.coffee'

The file is definitely there and accessible:

$ head /home/blah/.rvm/gems/ruby-1.9.3-p194/gems/guard-jasmine-1.8.1/lib/guard/jasmine/phantomjs/guard-jasmine.coffee
# This file is the script that runs within PhantomJS, requests the Jasmine specs
# and waits until they are ready.
phantom.injectJs 'lib/result.js'

Any ideas on what the problem might be?

Error leaves the webrick server running

I just had an app-specific issue where requests to the jasmine server were being redirected. When that was happening, guard-jasmine spec exited without stopping the server.

Here was the output I got:

Guard::Jasmine starts webrick test server on port 3001 in test environment.
Waiting for Jasmine test runner at http://localhost:3001/jasmine
ERROR: Jasmine test runner fails with response code 307

I had to manually ps -ef | grep '3001' and kill the server process.

It would be nice if Guard::Jasmine ensured that the server exits even if there is an error.

childprocess compatibility with selenium driver

Would it be possible to update the gemspec to set childprocess (~> 0.3)?

Trying to update to your latest, results in this error from bundler.

Bundler could not find compatible versions for gem "childprocess":
In Gemfile:
guard-jasmine (> 0.9.5) ruby depends on
childprocess (
> 0.2.8) ruby

selenium-webdriver (= 2.17.0) ruby depends on
  childprocess (0.3.0)

Thanks,

Michael

ERROR: Cannot decode JSON from PhantomJS runner: A JSON text must at least contain two octets!

guard-jasmine (0.7.0 with Phantomjs 1.3.0) block when running (run_on_change / run_all) and I got that when I do Ctrl+C:

ERROR: Cannot decode JSON from PhantomJS runner: A JSON text must at least contain two octets!
ERROR: Please report an issue at: https://github.com/netzpirat/guard-jasmine/issues
ERROR: 
ERROR: Guard::Jasmine failed to achieve its <run_all>, exception was:
NoMethodError: undefined method `[]' for nil:NilClass
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine/runner.rb:192:in `notify_spec_result'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine/runner.rb:164:in `evaluate_response'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine/runner.rb:34:in `block in run'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine/runner.rb:33:in `each'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine/runner.rb:33:in `inject'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine/runner.rb:33:in `run'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-jasmine-0.7.0/lib/guard/jasmine.rb:88:in `run_all'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:276:in `block in run_supervised_task'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:274:in `catch'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:274:in `run_supervised_task'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:207:in `block (3 levels) in run_guard_task'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:203:in `each'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:203:in `block (2 levels) in run_guard_task'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:202:in `catch'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:202:in `block in run_guard_task'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:201:in `each'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:201:in `run_guard_task'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:148:in `block in run_all'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:184:in `block in run'
<internal:prelude>:10:in `synchronize'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:181:in `run'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard.rb:147:in `run_all'
/Users/Thibaud/Codes/test/vendor/ruby/1.9.1/gems/guard-0.8.4/lib/guard/interactor.rb:31:in `block in start'

1.9.x gives me timeout error when guard first boots up

Ever since upgrading to 1.9.1, when I run bundle exec guard I get:

Guard::Jasmine starts Jasmine Gem test server on port 3002.
WARNING: Timeout while waiting for the server startup.
Waiting for Jasmine test runner at http://urtak-jasmine.dev/jasmine
ERROR: Jasmine test runner fails with response code 502

on the first run. But then if I edit a spec/javascripts/*.js spec file, it works. This is my setup: https://gist.github.com/3914760

Any thoughts?

Focus test not working in PhantomJS

I have keydown tests that seem to work fine in the browser with jasminerice

I am trying to get guard-jasmine working.

I need some assistance.

here is one of the tests that works in firefox and safari via jasmine rice and fails in phantomjs

it("is focused",function() {
  expect($(selector).filter(':focus').size()).toBe(0)
  $(selector).filter(':first').trigger('click.editable')
  expect($(selector).filter(':focus').size()).toBe(1)
})

Rake taks doesn't exit with 0 status code

Hi,

The provided rake task exits with the status code 127 instead of 0 when all tests are passing.
This makes impossible to pass the build :(

The rake task used on the CI:

require 'guard/jasmine/task'
Guard::JasmineTask.new

desc "Run everything on the CI server"
task :ci do
  Rake::Task['spec'].invoke
  Rake::Task['guard:jasmine'].invoke
  Rake::Task['cucumber'].invoke
end

then:

> bundle exec rake ci
# RSpec succeeds... Then:
Finished in 16.8 seconds
431 examples, 0 failures, 6 pending
Coverage report generated for RSpec to /Users/dnagir/proj/abc/coverage. 588 / 589 LOC (99.83%) covered.
Guard::Jasmine starts webrick test server on port 8888 in test environment.
Jasmine test runner is available at http://127.0.0.1:8888/jasmine
Run all Jasmine suites
Run Jasmine suite at http://127.0.0.1:8888/jasmine
# All the specs are passing here
3 specs, 0 failures
in 0.038 seconds
Guard::Jasmine stops server.

> echo $?
127

Probably there's something to do stopping the server, not sure.
Any workaround for now?

Test results differ from jasmine in "regular" browser run

When I run my specs in Chrome they work fine, 11 specs, all passing (see here: http://i.imgur.com/JPdHH.png)
When I run them through guard-jasmine (and phantomjs) the output is following:

> 
Run all Jasmine suites
Run Jasmine suite at http://localhost:3000/jasmine
AsciiIo.PlayerView
  constructor
    ✘ creates needed DOM elements inside player element
      ➤ TypeError: 'undefined' is not a function
    ✘ creates HudView instance passing proper DOM element
      ➤ TypeError: 'undefined' is not a function
    ✘ creates Movie instance
      ➤ TypeError: 'undefined' is not a function
  events
    ✘ toggles movie playback when terminal-click is fired on terminal
      ➤ TypeError: 'undefined' is not a function
      ➤ TypeError: 'null' is not an object
    ✘ toggles movie playback when hud-play-click is fired on hud
      ➤ TypeError: 'undefined' is not a function
      ➤ TypeError: 'null' is not an object
    ✘ seeks movie playback when hud-seek-click is fired on hud
      ➤ TypeError: 'undefined' is not a function
      ➤ TypeError: 'null' is not an object
    ✘ toggles fullscreen view when hud-fullscreen-click is fired on hud
      ➤ TypeError: 'undefined' is not a function
    ✘ stops cursor blinking when movie-finished is fired on movie
      ➤ TypeError: 'undefined' is not a function
      ➤ TypeError: 'null' is not an object
    ✘ feeds interpreter when movie-frame is fired on movie
      ➤ TypeError: 'undefined' is not a function
      ➤ TypeError: 'null' is not an object
  #play
    ✘ starts movie playback
      ➤ TypeError: 'undefined' is not a function
ERROR: 16 specs, 15 failures
in 0.034 seconds

First, bad thing is that some specs are failing (due to sth being undefine).
Second, number of specs differ (here is 16, jasmine in Chrome reported 11 and this is correct).
Third, it says 15 failures but displays only 10 failed cases.

How can I troubleshoot it? I have phantomjs compiled under my Fedora using instructions from here: http://code.google.com/p/phantomjs/wiki/BuildInstructions

Error decoding JSON from PhantomJS runner

I've been trying this on Windows 7 and get the error below, not the tests pass if accessed through the browser:

C:\ruby\apps\ProductCompare>guard
Your system doesn't support QUIT signal, so Ctrl-\ (Run all) won't work
Your system doesn't support TSTP signal, so Ctrl-Z (Reload) won't work
Guard is now watching at 'C:/ruby/apps/ProductCompare'
LiveReload 1.6 is waiting for a browser to connect.
Jasmine test runner is available at http://localhost:3000/jasmine
Run all Jasmine suites
Run Jasmine suite at http://localhost:3000/jasmine
ERROR: Cannot decode JSON from PhantomJS runner: lexical error: invalid char in json text.
2011-09-12T20:26:09 [DEBUG] WARNING: bool
(right here) ------^

ERROR: Please report an issue at: https://github.com/netzpirat/guard-jasmine/issues
ERROR: 2011-09-12T20:26:09 [DEBUG] WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded
2011-09-12T20:26:09 [DEBUG] WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded
2011-09-12T20:26:09 [DEBUG] WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded
{
"passed": true,
"stats": {
"specs": 3,
"failures": 0,
"time": 0.271
},
"suites": [
{
"description": "LiveSearch",
"specs": [
{
"description": "LiveSearch When using livesearch with no search value should correctly apply template.",
"passed": true
},
{
"description": "LiveSearch When using livesearch with no search value should load all results.",
"passed": true
},
{
"description": "LiveSearch When using livesearch with no search value should have correct content for second item.",
"passed": true
}
]
}
]
}

Failure to exit properly

Whenever I exit Guard with Guard::Jasmine running, I get this:

Guard::Jasmine stops server.
ERROR: Guard::Jasmine failed to achieve its <stop>, exception was:
NoMethodError: undefined method `poll_for_exit' for nil:NilClass
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-jasmine-0.9.6/lib/guard/jasmine/server.rb:41:in `stop'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-jasmine-0.9.6/lib/guard/jasmine.rb:92:in `stop'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:369:in `block in run_supervised_task'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:367:in `catch'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:367:in `run_supervised_task'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:212:in `block in stop'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:301:in `block (3 levels) in run_on_guards'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:300:in `each'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:300:in `block (2 levels) in run_on_guards'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:299:in `catch'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:299:in `block in run_on_guards'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:298:in `each'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:298:in `run_on_guards'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard.rb:211:in `stop'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard/interactor.rb:125:in `process_input'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard/interactors/simple.rb:12:in `read_line'
/Users/jimmy/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/guard-1.0.0/lib/guard/interactor.rb:93:in `block in start'

Guard::Jasmine has just been fired

Versions:

  • guard 1.0.0
  • guard-jasmine 0.9.6

Guardfile:

guard 'jasmine', server: :none, port: 3000, all_after_pass: false do
  watch(%r{app/assets/javascripts/(.+)\.(js\.coffee|js)}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
  watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js)})  { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
  watch(%r{spec/javascripts/spec\.(js\.coffee|js)})       { "spec/javascripts" }
end

still failing in plugin spec context

Hi,

In this still empty project, I'm willing to setup thing to refactor my gem and have cleaner workflow for specs.

So this is a plugin and many weird things:

  • in the guardfile, if I only let rspec and remove jasmine, specs are triggered when I edit them
  • If I only have jasmine guard, server is up but specs are not triggered when changed
  • If I have both guards, no spec triggered when I save spec files

Additional info:

I have the following notification: Guard::Jasmine starts Jasmine Gem test server on port 8888.

Bu trying to go to localhost:8888 in browser fails as if no server were actually started.

I'm a bit lost here :)

Thanks in advance,

Ben

PhantomJS opens in the Dock and is available to Tab through

When specs are executed, the PhantomJS appears in the Dock (so you can actually activate it).
It also appears when you are trying to switch between apps distracting you from the flow.

It would be good if PhantomJS would never appear anywhere and run in the background only.

guard-jasmine cli hangs with bundler 1.1

Looks like a new feature of bundler 1.1 will try to require 'guard/jasmine' given the the gem name of 'guard-jasmine' - version 1.1. 1.0 just gave up - version 1.0. Once it gets into guard/jasmine.rb it just hangs...I got lost trying to figure out where.

Not sure if there's a fix possible for it or not, but setting require to false in the Gemfile got it working again.

gem 'guard-jasmine', :require => false

Cannot decode JSON from PhantomJS runner: can't convert nil into String

I noticed by experimenting that if you provide a CoffeeScript class instead of a string as a first param of describe (although it's not supposed to be supported! But I'm new to this, so please bear with me), going to the browser at /jasmine will happily report failures properly (just with an empty description), while guard-jasmine will choke on the JSON parsing, and only when errors happen.

Here's an example json (trimmed down):

{
    "passed": false, 
    "stats": {
        "failures": 1, 
        "specs": 7, 
        "time": 0.017
    }, 
    "suites": [
        {
            ## missing description key here, which I suspect leads to the exception ##
            "passed": false, 
            "specs": [
                {
                    "description": "excludes that", 
                    "messages": [
                        "Expected 5 to equal 4."
                    ], 
                    "passed": false
                }
            ], 
            "suites": []
        }, 
        {
            "description": "A string is passed here and this one works ok", 
            "passed": true, 
            "specs": [
            ...
            ], 
            "suites": []
        }
    ]
}

This only happens when you have failures in the specs.

Suggestion: we could maybe default to an empty description instead of this exception, to be consistent with the behaviour seen in the browser?

What do you think?

Cannot setup the gem properly, fails on `phantomjs_bin_valid?`

Hi,

I'm trying to get the gem working in a plugin I'm beginning.

I guess I followed the necessary steps, including the installation of phantomjs.

Unfortunately, when I launch guard, I only get:

ERROR: Guard::Jasmine failed to achieve its <start>, exception was:
NoMethodError: undefined method `[]' for nil:NilClass
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-jasmine-1.1.0/lib/guard/jasmine/util.rb:51:in `phantomjs_bin_valid?'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-jasmine-1.1.0/lib/guard/jasmine.rb:84:in `start'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:387:in `block in run_supervised_task'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:385:in `catch'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:385:in `run_supervised_task'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/dsl.rb:144:in `block in after_reevaluate_guardfile'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:319:in `block (3 levels) in run_on_guards'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:318:in `each'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:318:in `block (2 levels) in run_on_guards'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:317:in `catch'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:317:in `block in run_on_guards'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:316:in `each'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:316:in `run_on_guards'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/dsl.rb:143:in `after_reevaluate_guardfile'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/dsl.rb:111:in `block in reevaluate_guardfile'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:295:in `block in run'
<internal:prelude>:10:in `synchronize'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:292:in `run'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/dsl.rb:108:in `reevaluate_guardfile'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:206:in `block in start'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/listeners/darwin.rb:57:in `call'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/listeners/darwin.rb:57:in `block in watch'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/vendor/darwin/lib/rb-fsevent/fsevent.rb:37:in `call'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/vendor/darwin/lib/rb-fsevent/fsevent.rb:37:in `run'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/listeners/darwin.rb:18:in `start'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard.rb:221:in `start'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/lib/guard/cli.rb:75:in `start'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.1/bin/guard:6:in `<top (required)>'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/bin/guard:19:in `load'
/Users/benjaminroth/.rvm/gems/ruby-1.9.2-p290/bin/guard:19:in `<main>'

Do you please have any idea of what's going on?

Thanks in advance,

Ben

Cannot decode JSON from PhantomJS runner: nesting of 20 is too deep

We discovered that when a test has 8 nested levels of describe blocks, the following error is generated when running via phantomjs. In our case we are running it via guard. 8 levels is rather deep, but in this case we were testing some workflow interaction.

Is it possible to increase the maximum allowed depth?

ERROR: Cannot decode JSON from PhantomJS runner: nesting of 20 is too deep

Guard::Jasmine hangs on server startup

Hi, I've found a few of issues about this topic, but none was my case. Or so I think, I have almost no experience in Rails yet I want to configure our app so I can write tests for the frontend.
The odd thing is that the configuration I have worked fine on my old pc (I've spent a few hours on it :P), now I've moved on to a newer one and got this problem, so I don't think I should change the configurations.
When I start guard with bundle exec guard this is what I get:

Guard uses NotifySend to send notifications.
Guard is now watching at '/home/lazywithclass/workspace/faceit-frontend'
Guard::Jasmine starts webrick test server on port 8888 in development environment.

And nothing more.

My configuration is this:

  • Rails 3.2.3
  • Guard::Jasmine version 1.8.1 (even if bundle show guard-jasmine shows /var/lib/gems/1.9.1/gems/guard-jasmine-1.5.0, is it correct I have 1.5.0 showing there as opposed to having 1.8.1?)
  • Bundler version 1.2.0

In my Gemfile I have jasmine, jasminerice, guard and guard-jasmine (along with others) for :test and for :development.
This is my Guardfile

group :frontend do
  guard 'jasmine', :specdoc => :always, :console => :always do
    # wathing my dirs for change
  end
end

I have tried to use thin as a server but that doesn't change it, I've tried to wait but I don't get the hint message.
Sorry if this is trivial but I didn't find any answer suitable to my case.
Thanks in advance for any hint on this.

ERROR: Cannot decode JSON from PhantomJS runner: 756: unexpected token at 'TypeError: 'null' is not an object

ERROR: TypeError: 'null' is not an object

phantomjs://webpage.evaluate():4
phantomjs://webpage.evaluate():1
/Users/roc/.rvm/gems/ruby-1.9.2-p290@sc/gems/guard-jasmine-0.5.0/lib/guard/jasmine/phantomjs/run-jasmine.coffee:35
/Users/roc/.rvm/gems/ruby-1.9.2-p290@sc/gems/guard-jasmine-0.5.0/lib/guard/jasmine/phantomjs/run-jasmine.coffee:16

this happens when i added a new spec which include sinon spy

Timeout requesting Jasmine test runner

When the asset can't be compiled properly due to an error (require non_existing_file), the timeout occurs.

This doesn't tell much and it would be better if we could see the actual error from Sprockets.

The error:

Run Jasmine suite at http://localhost:8888/jasmine

ERROR: An error occurred: Timeout requesting Jasmine test runner!

Ruby 1.9.3p125 breaks rake task

I can use the Guard rake task with no issues on MRI 1.9.3-p0, but on the 1.9.3-p125 it breaks:

> b rake ci --trace
** Invoke ci (first_time)
** Execute ci
** Invoke guard:jasmine (first_time)
** Execute guard:jasmine
rake aborted!
uninitialized constant Guard::Guard::Jasmine
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/guard-jasmine-0.9.14/lib/guard/jasmine/task.rb:37:in `block (2 levels) in initialize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/dnagir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/dnagir/proj/PropConnect/lib/tasks/ci.rake:8:in `block in <top (required)>'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/dnagir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `load'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `<main>'
Tasks: TOP => guard:jasmine

Apparently p125 has a breaking change :)

:auto should check to see which servers are available rather than default to webrick

We're using thin and it's a little inconvenient to specify -s thin in all of the places necessary. It would be groovy if :auto was a little smarter. For example, if one of thin, unicorn, etc are detected, they should be selected when using auto. If none are, then webrick is a fine last resort.

If more than one are detected, either select the first found or fallback to webrick and require one to be explicitly specified.

What do you think? If it's reasonable, I'm happy to take a stab.

cli not working

I can't get the cli to work with either guard-jasmine or bundle exec guard-jasmine. It can't find Net::HTTP in util.rb. It's required in jasmine.rb, but I don't see where that gets required when using the cli.

Adding require 'net/http' to util.rb fixes it, but wasn't sure if I was missing something.

Problem with console.log

When I add some console.log 'stuff' in my javascripts assets I got:

Run Jasmine tests: http://localhost:3000/jasmine?spec=Period
ERROR: Guard::Jasmine failed to achieve its <run_on_change>, exception was:
MultiJson::DecodeError: 743: unexpected token at 'stuff
stuff
stuff
stuff
stuff
stuff
{
  "suites": [],
  "stats": {
    "specs": 44,
    "failures": 0,
    "time": 0.047
  }
}
'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/json_pure-1.5.4/lib/json/common.rb:148:in `parse'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/json_pure-1.5.4/lib/json/common.rb:148:in `parse'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb:13:in `decode'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json.rb:65:in `decode'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-jasmine-0.2.0/lib/guard/jasmine/runner.rb:108:in `evaluate_result'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-jasmine-0.2.0/lib/guard/jasmine/runner.rb:30:in `block in run'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-jasmine-0.2.0/lib/guard/jasmine/runner.rb:29:in `each'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-jasmine-0.2.0/lib/guard/jasmine/runner.rb:29:in `inject'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-jasmine-0.2.0/lib/guard/jasmine/runner.rb:29:in `run'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-jasmine-0.2.0/lib/guard/jasmine.rb:62:in `run_on_change'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard.rb:106:in `supervised_task'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard.rb:84:in `block (2 levels) in run_on_change'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard.rb:80:in `each'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard.rb:80:in `block in run_on_change'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard.rb:95:in `run'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard.rb:79:in `run_on_change'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard/listener.rb:50:in `block (2 levels) in start_reactor'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard/listener.rb:46:in `loop'
/Users/Thibaud/.../vendor/ruby/1.9.1/gems/guard-0.7.0.rc1/lib/guard/listener.rb:46:in `block in start_reactor'

Guard::Jasmine has just been fired

Any ideas why? :)

ERROR: Cannot decode JSON from PhantomJS runner: 757

I see that some have reported this error previously, but this seems to be a new occurrence.

ERROR: Cannot decode JSON from PhantomJS runner: 757: unexpected token at '{"error":"Timeout waiting for the Jasmine test results!\n\nJasmine1.1.0 revision 1308150691\nShow  passed skipped\nrun all28 specs, 0 failures in 0.099sFinished at Wed Jun 06 2012 11:55:19 GMT-0700 (PDT)"}
'
ERROR: Please report an issue at: https://github.com/netzpirat/guard-jasmine/issues
ERROR: JSON response: {"passed":true,"stats":{"failures":0,"specs":28,"time":0.099},"suites":[{"description":"Album","passed":true,"specs":[{"description":"has a title","passed":true},{"description":"can set a new title","passed":true},{"description":"has a default album cover","passed":true},{"description":"can set a new cover","passed":true},{"description":"has an array of tracks","passed":true},{"description":"has tracks with artists and titles","passed":true}],"suites":[{"description":"player","passed":true,"specs":[{"description":"initializes an audio player if passed the id of an audio element","passed":true},{"description":"adds an audio element and initializes it if no ID is passed","passed":true},{"description":"sets the URL of the audio element to the first track in the album","passed":true},{"description":"has a track duration","passed":true},{"description":"prettifies display times","passed":true},{"description":"has a current time","passed":true},{"description":"switches between playing and paused","passed":true},{"description":"has a playing track","passed":true},{"description":"changes the playing track","passed":true},{"description":"has a starting play index of 0 and a starting track","passed":true},{"description":"advances tracks","passed":true},{"description":"moves to previous track if current time is less than 5 seconds, otherwise sets time back to 0:00","passed":true},{"description":"moves play index to 0 when you've reached the end","passed":true},{"description":"moves to the previous track if play index is greater than 0","passed":true},{"description":"can't move to a play index below 0","passed":true}],"suites":[]}]},{"description":"Track","passed":true,"specs":[{"description":"has a title","passed":true},{"description":"can set a new title","passed":true},{"description":"has an artist","passed":true},{"description":"can set a new artist name","passed":true},{"description":"has a url","passed":true},{"description":"can set a new url","passed":true},{"description":"points to a properly formatted MP3 URL","passed":true}],"suites":[]}]}
{"error":"Timeout waiting for the Jasmine test results!\n\nJasmine1.1.0 revision 1308150691\nShow  passed skipped\nrun all28 specs, 0 failures in 0.099sFinished at Wed Jun 06 2012 11:55:19 GMT-0700 (PDT)"}

Any idea what might be the culprit? If I run the suite in the browser, it works as expected, and from the JSON, it looks like the tests are running correctly, so... it's just a matter of the JSON coming back wrong? I've uninstalled and re-installed Phantom.js, in case there's a problem there, but that didn't appear to help. Thanks very much for any help!

Version 1.9.0 seems to break the CLI

When trying to use the CLI with 1.9.0 it refuses to run with the error message:

ERROR: wrong number of arguments (4 for 1)

It works perfectly with 1.8.3, this is the exact command I use:

bundle exec guard-jasmine -p 8888 -u http://localhost:8888/ --console=never

Looked through the commits but couldn't see anything obvious change that could break it, any ideas?

to_version method undefined?

Hey there,

I've been having a tough time setting up guard-jasmine for the first time, and i just noticed this while running it today.

$ bundle exec guard --debug
Please install rb-fsevent gem for Mac OSX FSEvents support
Using polling (Please help us to support your system better than that).
Please install growl_notify or growl gem for Mac OS X notification support and add it to your Gemfile
Guard is now watching at '...www_rails'
Guard::RSpec is running, with RSpec 2!
Bundle already up-to-date
ERROR: Guard::Jasmine failed to achieve its , exception was:
NoMethodError: undefined method to_version' for "1.4.1\n":String /guard-jasmine-0.9.2/lib/guard/jasmine.rb:185:inphantomjs_bin_valid?'
/guard-jasmine-0.9.2/lib/guard/jasmine.rb:76:in start' /guard-0.8.4/lib/guard.rb:276:inblock in run_supervised_task'
/guard-0.8.4/lib/guard.rb:274:in catch' /guard-0.8.4/lib/guard.rb:274:inrun_supervised_task'
/guard-0.8.4/lib/guard.rb:207:in block (3 levels) in run_guard_task' /guard-0.8.4/lib/guard.rb:203:ineach'
/guard-0.8.4/lib/guard.rb:203:in block (2 levels) in run_guard_task' /guard-0.8.4/lib/guard.rb:202:incatch'
/guard-0.8.4/lib/guard.rb:202:in block in run_guard_task' /guard-0.8.4/lib/guard.rb:201:ineach'
/guard-0.8.4/lib/guard.rb:201:in run_guard_task' /guard-0.8.4/lib/guard.rb:119:instart'
/guard-0.8.4/lib/guard/cli.rb:61:in start' /thor-0.14.6/lib/thor/task.rb:22:inrun'
/thor-0.14.6/lib/thor/invocation.rb:118:in invoke_task' /thor-0.14.6/lib/thor.rb:263:indispatch'
/thor-0.14.6/lib/thor/base.rb:389:in start' /guard-0.8.4/bin/guard:6:in<top (required)>'
/bin/guard:19:in load' /bin/guard:19:in

'

Is there something I am missing?

In my bundle file, i am doing
gem 'jasmine'
gem 'guard-jasmine'

I am following the rails 3 installation method, with ruby 1.9.3p0.

Thanks for any help, I really would like to give what you've built a shot only if I could get it working!

Fails to re-run jasmine specs after modification (Windows).

On Windows 7 when I run guard it correctly runs my specs and notifies me of the result, it then also notices when I change the spec file but for some reason doesn't re-run the specs.

C:\ruby\apps\ProductCompare>guard
←[0mGuard is now watching at 'C:/ruby/apps/ProductCompare'←[0m
←[0mGuard::Jasmine starts Rack test server on port 8888 in development environment.←[0m
C:/Users/Admin/.pik/rubies/Ruby-193-p0/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher.rb:7: Use RbConfig instead of obsolete and deprecated Config.
[2011-11-27 22:07:36] INFO  WEBrick 1.3.1
[2011-11-27 22:07:36] INFO  ruby 1.9.3 (2011-10-30) [i386-mingw32]
[2011-11-27 22:07:36] INFO  WEBrick::HTTPServer#start: pid=6804 port=8888
←[0mJasmine test runner is available at http://localhost:8888/jasmine←[0m
←[0m←[0mRun all Jasmine suites←[0m
←[0mRun Jasmine suite at http://localhost:8888/jasmine←[0m
←[0m←[0;33mWizard←[0m←[0m
←[0m←[0;33m  When creating a three step wizard←[0m←[0m
...
←[0m←[0;31m      ? ReferenceError: Can't find variable: ChooseProductStep in coffeescripts/Wizard_spec.js on line 5←[0m←[0m
←[0;31mERROR: ←[0m←[0;31m4 specs, 4 failures
in 0.011 seconds←[0m
#<MatchData "spec/javascripts/coffeescripts/Wizard_spec.coffee" 1:"coffeescripts/Wizard" 2:"coffee">
←[0m←[0mRun all Jasmine suites←[0m
←[0mRun Jasmine suite at http://localhost:8888/jasmine←[0m

Further changes to the files are not picked up and the specs never appear to run.

Timeout with Travis CI and version 1.2.1

Hi!

I think between version 1.2.0 and 1.2.1 a bug was introduced. Maybe it is this commit: 8f1a0cd

Let me explain my thoughts. About two days ago our project builds started to fail on Travis due to a timeout. The only thing we changed was upgrading guard-jasmine to 1.2.1. The most recent failing build can be found here: http://travis-ci.org/#!/stravid/slotcars/builds/1463778

After downgrading to version 1.2.0 our builds started to work again: http://travis-ci.org/#!/stravid/slotcars/builds/1463971

The change set on our project which fixed the build can be found here: stravid/slotcars@ccf5ae0...a5568c4

I'm not entirely sure if I'm correct with this assumption. All I know is that after downgrading guard-jasmine the Travis CI builds started to work again.

Thanks for your time!

ERROR: Cannot decode JSON from PhantomJS runner: can't convert String into Integer

Looking around I found that the json response 'errors' have the 'trace' property wrapped around a array, so when method report_spec_errors is called in the line

Formatter.spec_failed(indent("    ➜ Exception: #{ error['msg']  } in #{ error['trace']['file'] } on line #{ error['trace']['line'] }", level))

a exception is raised cause error['trace'] is a array not a hash, and the paramenter for method [] needs to be a Integer, I solved it forcing the first element with [0]

Formatter.spec_failed(indent("    ➜ Exception: #{ error['msg']  } in #{ error['trace'][0]['file'] } on line #{ error['trace'][0]['line'] }", level))

Here is a fragment of my json response

"errors":[{"msg":"TypeError: Fake XHR onreadystatechange handler threw exception: 'undefined' is not a function",
"trace":[{"file":"http://localhost:8888/assets/sinon.js?body=1","function":"","line":567}]},
{"msg":"TypeError: Fake XHR onreadystatechange handler threw exception: 'undefined' is not a function",
"trace":[{"file":"http://localhost:8888/assets/sinon.js?body=1","function":"","line":567}]},
{"msg":"TypeError: Fake XHR onreadystatechange handler threw exception: 'undefined' is not a function",
"trace":[{"file":"http://localhost:8888/assets/sinon.js?body=1","function":"","line":567}]}]

ERROR: Cannot start Rack server: undefined method `[]' for nil:NilClass

When using the rake task I get the error:

> bundle exec rake ci --trace
** Invoke ci (first_time)
** Execute ci
** Invoke guard:jasmine (first_time)
** Execute guard:jasmine
Guard::Jasmine starts webrick test server on port 8888 in test environment.
ERROR: Cannot start Rack server: undefined method `[]' for nil:NilClass

The usage of the Rake task:

task :ci do
  require 'guard/jasmine/task'
  Guard::JasmineTask.new
  Rake::Task['guard:jasmine'].invoke
end

Using guard-jasmine (1.0.2).

Command line works but rake task does nothing

I'm using the following rake task

task 'jasminetest' do
  require 'guard/jasmine/task'
  Guard::JasmineTask.new
end

If I just run 'guard-jasmine' I get a bunch of passing/failed tests but by running 'rake jasminetest' I get nothing outputted. Walking through the code it looks like the block that creates a task doesn't actually run anything. Calling execute on the task causes it to fire up and run the tasks though.

I added a pull request that does this. I'm not sure this is the right behavior but it does run the tests.
#54

Is this supposed to automatically get executed or am I missing something from my rake task? I went right from the readme.

Guard::Jasmine version 1.1.0 hangs forever when running from CLI

Using bundler 1.1.3. Running on MacOS X 10.7.3.

$ bundle exec guard-jasmine spec
Guard::Jasmine starts webrick test server on port 8888 in test environment.
( I patiently wait for 15 minutes )
^C/Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/guard-jasmine-1.1.0/lib/guard/jasmine/server.rb:113:in `sleep': Interrupt
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/guard-jasmine-1.1.0/lib/guard/jasmine/server.rb:113:in `wait_for_server'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/guard-jasmine-1.1.0/lib/guard/jasmine/server.rb:35:in `start'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/guard-jasmine-1.1.0/lib/guard/jasmine/cli.rb:103:in `spec'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/gems/guard-jasmine-1.1.0/bin/guard-jasmine:3:in `<top (required)>'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/bin/guard-jasmine:19:in `load'
    from /Users/sfalvo/.rvm/gems/ruby-1.9.3-p125@my-project/bin/guard-jasmine:19:in `<main>'

Does not work with mountable engines

Unfortunately this is currently not working when used in a mountable engine.

dev4:rails vincent$ rails -v
Rails 3.2.2
dev4:rails vincent$ rvm use 1.9.3
Using /Users/vincent/.rvm/gems/ruby-1.9.3-p125
dev4:rails vincent$ rails plugin new gajas --mountable
      create  
      create  README.rdoc
      create  Rakefile
      create  gajas.gemspec
      create  MIT-LICENSE
      create  .gitignore
      create  Gemfile
      create  app
      create  app/controllers/gajas/application_controller.rb
      create  app/helpers/gajas/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/gajas/application.html.erb
      create  app/assets/images/gajas
      create  app/assets/images/gajas/.gitkeep
      create  config/routes.rb
      create  lib/gajas.rb
      create  lib/tasks/gajas_tasks.rake
      create  lib/gajas/version.rb
      create  lib/gajas/engine.rb
      create  app/assets/stylesheets/gajas/application.css
      create  app/assets/javascripts/gajas/application.js
      create  script
      create  script/rails
      create  test/test_helper.rb
      create  test/gajas_test.rb
      append  Rakefile
      create  test/integration/navigation_test.rb
  vendor_app  test/dummy
         run  bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.2.0) 
Using activesupport (3.2.3) 
Using builder (3.0.0) 
Using activemodel (3.2.3) 
Using erubis (2.7.0) 
Using journey (1.0.3) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.2) 
Using actionpack (3.2.3) 
Using mime-types (1.18) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.4) 
Using actionmailer (3.2.3) 
Using arel (3.0.2) 
Using tzinfo (0.3.32) 
Using activerecord (3.2.3) 
Using activeresource (3.2.3) 
Using bundler (1.0.22) 
Using rack-ssl (1.3.2) 
Using json (1.6.6) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (3.2.3) 
Using rails (3.2.3) 
Using gajas (0.0.1) from source at /xyz/gajas 
Using jquery-rails (2.0.2) 
Using sqlite3 (1.3.5) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

now lets go into the engine root cd gaja

dev4:gajas vincent$ cat gajas.gemspec 
$:.push File.expand_path("../lib", __FILE__)

# Maintain your gem's version:
require "gajas/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
  s.name        = "gajas"
  s.version     = Gajas::VERSION
  s.authors     = ["TODO: Your name"]
  s.email       = ["TODO: Your email"]
  s.homepage    = "TODO"
  s.summary     = "TODO: Summary of Gajas."
  s.description = "TODO: Description of Gajas."

  s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
  s.test_files = Dir["test/**/*"]

  s.add_dependency "rails", "~> 3.2.3"
  s.add_dependency "guard-jasmine"
  s.add_dependency "jasminerice"
  s.add_dependency "jquery-rails"

  s.add_development_dependency "sqlite3"
end

lets bundle and generate bundle && guard init jasmine, now create the necessary files and dirs

mkdir -p spec/javascripts
echo -e "#=require application\n#=require_tree ./" > spec/javascripts/spec.js.coffee
echo -e "/*\n * add css using =require application\n */" > spec/javascripts/spec.css

now lets give it a go test/dummy/script/rails s,
going to http://localhost:3000/jasmine and http://localhost:3000/gaja/jasmine returns No route matches [GET] "/jasmine" and No route matches [GET] "/gaja/jasmine" respectively

Guard encounters the following problem:

dev4:gajas vincent$ bundle exec guard
Guard could not detect any of the supported notification libraries.
Guard is now watching at '/xyz/gajas'
ERROR: Jasmine test runner isn't available at http://localhost:8888/jasmine: Connection refused - connect(2)
ERROR: Jasmine test runner isn't available at http://localhost:8888/jasmine: Connection refused - connect(2)

The spec is not executed when file is changed

When I update and save the spec (or implementation) it is not re-executed.

The Guard file:

  guard 'jasmine' do
    watch(%r{app/assets/javascripts/(.+)\.(js\.coffee|js)}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
    watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js)})  { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
    watch(%r{spec/javascripts/spec\.(js\.coffee|js)})       { "spec/javascripts" }
  end

But when I update the spec/javascripts/spec.js.coffthen all specs are indeed executed.

Hangs while trying to start Jasmine server with :server => :jasmine_gem

I want to use guard-jasmine to run my tests against a vanilla Jasmine server. I configured my Guardfile with:

guard 'jasmine', :server => :jasmine_gem, :jasmine_url => 'http://localhost:8888/'

and the necessary guard-coffeescript directives above that to compile my CoffeeScript files. The problem is when I start guard, it hangs with the last line of output beging:

Guard::Jasmine starts Jasmine Gem test server on port 8888.

My Jasmine runner is not available at http://localhost:8888/ (I tried loading it in the browser). Guard is blocked at this point and can't process any events.

I can work around it by specifying :server => :none and manually launching rake jasmine before running guard. Then everything works beautifully. The JavaScript specs run really fast. It would be more convenient if :server => :jasmine_gem launched the server for me.

Let me know if you need any more info about my setup to debug this.

The failures are not logged in the right order when there are nested describes

I have this:

describe 'NestedDescribes', ->

  it 'should not be nested', ->
    expect(0).toEqual(1)

  describe 'Nested 1', ->
    it 'should be nested', ->
      expect(0).toEqual(1)

  it 'should not be nested either', ->
    expect(0).toEqual(1)

And I get the following log:

NestedDescribes
  ✘ should not be nested either
    ➤ Expected 0 to equal 1.
  Nested 1
    ✘ should not be nested
      ➤ Expected 0 to equal 1.
    ✘ should be nested
      ➤ Expected 0 to equal 1.

Timeout Jasmine Runner

Hey netzpirat,

While I have manually patched my guard-jasmine with the to_version patch, I have unfortunately run into another issue.

Adrians-MacBook-Pro:www_rails adrian$ bundle exec guard --verbose
Please install rb-fsevent gem for Mac OSX FSEvents support
Using polling (Please help us to support your system better than that).
Please install growl_notify or growl gem for Mac OS X notification support and add it to your Gemfile
Guard is now watching at '/Users/adrian/Development/projects/Gogobot-Rails3/www_rails'
Guard::RSpec is running, with RSpec 2!
Bundle already up-to-date
Guard::Jasmine starts Jasmine Gem test server on port 8888.
[2012-01-06 10:46:46] INFO  WEBrick 1.3.1
[2012-01-06 10:46:46] INFO  ruby 1.9.3 (2011-10-30) [x86_64-darwin11.2.0]
[2012-01-06 10:46:46] INFO  WEBrick::HTTPServer#start: pid=8707 port=8888
Jasmine test runner is available at http://localhost:8888/
Run all Jasmine suites
Run Jasmine suite at http://localhost:8888/
ERROR: An error occurred: Timeout waiting for the Jasmine test results!

loading
^C[2012-01-06 10:47:09] INFO  going to shutdown ...

Here is the guardfile:

guard 'rspec', :version => 2, :cli => '--color --drb --format Fuubar', :all_on_start => false, :all_after_pass => false do
  watch(%r{^spec/.+_spec\.rb$})
  watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch('spec/spec_helper.rb')  { "spec" }

  # Rails example
  watch(%r{(?:^|\/)spec/.+_spec\.rb$})
  watch(%r{(?:^|\/)app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{(?:^|\/)lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch(%r{(?:^|\/)app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  watch(%r{(?:^|\/)spec/support/(.+)\.rb$})                  { "spec" }
  watch('spec/spec_helper.rb')                        { "spec" }
  watch('config/routes.rb')                           { "spec/routing" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }

  # Capybara request specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }

  watch(%r{^spec/factories/(.+)\.rb$})
end

guard 'bundler' do
  watch('Gemfile')
end

guard 'jasmine', server: :jasmine_gem, jasmine_url: 'http://localhost:8888/'  do
  watch(%r{app/assets/javascripts/(.+)\.(js\.coffee|js|coffee)$}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
  watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js|coffee)$})  { |m| puts m.inspect; "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
  watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$})       { "spec/javascripts" }
end

Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.9'
gem 'babosa'
gem 'ar-extensions'
gem 'mysql2', '< 0.3'
gem 'validatable'
gem 'dalli'
gem 'memcache-client'
gem 'authlogic'
gem 'oauth'
gem 'twitter_oauth'
gem 'koala'
gem 'htmlentities'
gem 'aws-s3', :require => 'aws/s3'
gem 'right_aws'
gem 'flickraw'
gem 'activeadmin'
gem 'will_paginate'
gem 'kaminari'
gem 'rubyzip', :require => 'zip/zip'
gem 'nokogiri'
gem 'jammit'
gem 'closure-compiler'
gem 'yui-compressor', :require => 'yui/compressor'
gem 'geokit'
gem 'text'
gem 'rapleaf_api'
gem 'hashie'
gem 'foursquare2'
gem 'oauth2'
gem 'google_places'
gem 'cancan'
gem 'juggernaut'
gem 'whenever', :require => false
gem 'twitter', '1.6.2'
gem 'sunspot', :require => 'sunspot'
gem 'bcrypt-ruby', :require => 'bcrypt'
gem 'compass'
gem 'rmagick', '2.12.2', :require => false
gem 'hiredis', '~> 0.3.1'
gem 'redis', '~> 2.2.0', :require => ['redis/connection/hiredis', 'redis']
gem 'redis-namespace'
gem 'rturk'
gem 'thin'
gem 'capistrano'
gem 'capistrano-ext'
gem 'resque'
gem 'resque-lock'
gem 'resque-loner'
gem 'resque_mailer'
gem "therubyracer", "~> 0.9.8"
gem 'slim'
gem 'execjs'
gem 'sunspot_rails', '~> 1.2.1'
gem 'bitmask_attributes'
gem 'airbrake'
gem 'god'
gem 'resque-scheduler'
gem 'rack-offline'
gem 'cotendo'
gem 'newrelic_rpm', '~> 3.3.0'
gem 'simplegeo'
gem 'urbanairship', '~> 1.1.0'
gem 'enum_column3'
gem 'rvm'
gem 'squeel'

group :development, :test do
  gem 'factory_girl_rails'
  gem 'rspec-rails'
  gem "shoulda"
  gem 'factory_girl_rails'
  gem 'spork', '~> 0.9.0.rc'
  gem 'capybara'
  gem 'selenium-webdriver'
  gem 'capybara-webkit'
  gem 'launchy'
  gem 'pickle'
  gem 'faker'
  gem 'cucumber', '1.0.2'
  gem 'cucumber-rails', '1.0.2'
  gem 'database_cleaner', '~> 0.6.7'
  gem 'guard', '~> 0.8.2'
  gem 'guard-rspec'
  gem 'guard-bundler'
  gem 'fuubar'
  gem 'active_reload'
  gem 'foreman'
  gem 'headless'
  gem 'vcr'
  gem 'fakeweb'
  gem 'awesome_print'
  gem 'timecop'
  gem 'brice'
  gem 'no_peeping_toms'
  gem 'jasmine'
  gem 'version'
  gem 'guard-jasmine'
end

Phantom JS

Adrians-MacBook-Pro:www_rails adrian$ phantomjs --version
1.4.1

Using latest Jasmine (1.1.2) gem / guard-jasmine (0.9.2) from rubygems.org

Again, using ruby 1.9.3-p0 and Rails 3.0.9. Thanks for the response yesterday, helped resolve the first issue!

rake task

it would be awesome if there were an out of the box rake task... it's pretty simple to make one with the cli runner, but I think it would be nice to just be able to call rake jasmine:guard_ci or something along those lines.

:specdoc varies when running all versus single file

Hey,

First of all thanks for the great work.

I have a feature request. When using guard-rspec, I set it to run with `--format progress`` when running all the specs, and to do a full doc formatting when running individual files. I've found this is a good balance between debugging, and having some clue how much longer the full suite will take.

I would love to have a similar option with guard-jasmine. Either an option to pass specific options in for :run_all, or atleast an extra option into :specdoc to support :always_on_single_files (named something better probably)

Thanks again,

Forrest

guard init jasmine is creating a bad configuration

I guess that the "guard init jasmine" configuration belongs to here, if not, I'm sorry.

What we expect is this:

guard 'jasmine' do
  watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$})         { "spec/javascripts" }
  watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$})
  watch(%r{app/assets/javascripts/(.+?)\.(js\.coffee|js|coffee)$})  { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
end

What we get is this:

guard 'jasmine' do
  watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$})         { "spec/javascripts" }
  watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$})
  watch(%r{app/assets/javascripts/(.+?)\.(js|coffee)})  { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
end

Notice the last watch. It is ignoring the ".js.coffee" files.

I hope this helps. Thank you.

EDIT: I see the pull that changed it: b6abeb7

Even when the change should work with .js.coffee files, at least is not working for me. If I change my Javascript, guard doesn't react.

ERROR: Cannot decode JSON from PhantomJS runner

ERROR: Cannot decode JSON from PhantomJS runner: 705: unexpected token at '2012-01-11T23:25:51 [DEBUG] Connected to accessibility bus at:  "unix:abstract=/tmp/dbus-kci3ZPUepy,guid=0aa6231e949e1034b6880b7300002fe9" 
2012-01-11T23:25:51 [DEBUG] Registered DEC:  true 
{
  "passed": false,
  "stats": {
    "specs": 22,
    "failures": 1,
    "time": 0.687
  },

I supose stderr somehow appeared in json so it cannot be parsed properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.