Giter Site home page Giter Site logo

jasmine-gem's Introduction

A JavaScript Testing Framework

Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.

Upgrading from Jasmine 4.x? Check out the upgrade guide.

Contributing

Please read the contributors' guide.

Installation

There are several different ways to install Jasmine, depending on your environment and how you'd like to use it. See the Getting Started page for details.

Usage

See the documentation site, particularly the Your First Suite tutorial for information on writing specs, and the FAQ.

Supported environments

Jasmine tests itself across popular browsers (Safari, Chrome, Firefox, and Microsoft Edge) as well as Node.

Environment Supported versions
Node 18, 20, 22
Safari 15-17
Chrome Evergreen
Firefox Evergreen, 102, 115
Edge Evergreen

For evergreen browsers, each version of Jasmine is tested against the version of the browser that is available to us at the time of release. Other browsers, as well as older & newer versions of some supported browsers, are likely to work. However, Jasmine isn't tested against them and they aren't actively supported.

To find out what environments work with a particular Jasmine release, see the release notes.

Maintainers

Maintainers Emeritus

Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2023 The Jasmine developers
This software is licensed under the MIT License.

jasmine-gem's People

Contributors

cbaines avatar cice avatar cprodhomme avatar dentarg avatar fofr avatar heythisisnate avatar intrepidd avatar jboyens avatar jordi-pivotal avatar jvortmann avatar lukeasrodgers avatar mcolyer avatar mgodwin avatar moll avatar myers avatar patrickking avatar pf-bajorek avatar pivotalops avatar ragaskar avatar richardiux avatar rizwanreza avatar salbertson avatar sgravrock avatar sheelc avatar soutaro avatar stoivo avatar thizzle avatar tjarratt avatar tooky avatar xian 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  avatar  avatar  avatar  avatar  avatar

jasmine-gem's Issues

rails generator doesn't create all files

On a rails 3.2 project with the latest jasmine from git (SHA c72e8d2)

When we run

rails g jasmine:install

The generator only creates the spec/javascripts/support/jasmine.yml file. It doesn't create jasmine_runner.rb file that is need to actually run successfully.

Slowness with IE8 compared to Jasmine 1.1.x

Hey guys,

I've noticed a strange slowness with the new jasmine gem compared to the old version.

Have 3700 specs, running on IE8 Win 7

Anyways, not an actual issue but wondering if anyone know what could be causing the issue.

Runtime with Jasmine 1.1.x (Selenium-rc 2.20.0) 5 mins
Runtime with Jasmine 1.2.x (Selenium-webdriver 2.26.0) 13 mins

I'm wondering if there is a significant change in between RC vs Webdriver, or is it just parsing of rspecs, or JS slowness in the actual run.html.

I'd love to dig into the issue and try and fix it, would appreciate if someone could send me in the right direction so i'm not hunting between the 3 possibilities.

Thanks.

uninitialized constant Jasmine::SeleniumDriver::JSON (NameError)

When I run rake jasmine:ci it raises the following stack trace:

selenium_driver.rb:48:in `eval_js': uninitialized constant Jasmine::SeleniumDriver::JSON (NameError)
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/jasmine-1.2.0.rc2/lib/jasmine/config.rb:60:in `eval_js'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/jasmine-1.2.0.rc2/lib/jasmine/spec_builder.rb:155:in `eval_js'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/jasmine-1.2.0.rc2/lib/jasmine/spec_builder.rb:56:in `load_suite_info'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/jasmine-1.2.0.rc2/lib/jasmine/spec_builder.rb:18:in `start'
  from /Users/emerson/projetos/catalogo/spec/javascripts/support/jasmine_runner.rb:18:in `<top (required)>'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `block in load_spec_files'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `map'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in `run'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
  from /Users/emerson/.rvm/gems/ruby-1.9.2-p290@catalogo/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'
rake aborted!

The browsers keeps open.

IIf I put require 'json' on top of this file it works.

Installing Jasmine on Rails 2.3.14 / Rake 0.8.7 breaks rake tasks

After following the installation instructions and trying to run rake I get the following stack trace. A little help?

$ rake jasmine --trace
(in /Users/seth/Work/cashboard/site/trunk)
rake aborted!
undefined method `map' for nil:NilClass
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems.rb:223:in `activate'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/jasmine-1.2.0/lib/jasmine/railtie.rb:1
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/jasmine-1.2.0/lib/jasmine.rb:14
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/Users/seth/Work/cashboard/site/trunk/lib/tasks/jasmine.rake:2
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:171:in `load'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:171:in `load'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/railties/lib/tasks/rails.rb:14
/Users/seth/Work/cashboard/site/trunk/vendor/rails/railties/lib/tasks/rails.rb:14:in `each'
/Users/seth/Work/cashboard/site/trunk/vendor/rails/railties/lib/tasks/rails.rb:14
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/Users/seth/Work/cashboard/site/trunk/Rakefile:9
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/opt/ruby-enterprise/bin/rake:19:in `load'
/opt/ruby-enterprise/bin/rake:19

Firefox does not close when I run rake jasmine:ci

Hi guys,

I updated the version of jasmine to 1.0.2.0 on last monday. But when I run rake jasmine:ci the browser (Firefox in this case) does not close, after some seconds waiting jasmine closes the browser in give a message error about timeout.

When I run rake jasmine my tests works fine, all pass...I tried to run rake jasmine:ci JASMINE_BROWSER = chrome and it works.

Is there a bug in the new version and rake jasmine:ci with Firefox?

Regards

src_files not loading in v1.2.1

After upgrading from v1.2.0 to v1.2.1, the src_files are no longer included for some reason. I've tracked it down to this commit, and have been digging down into sprockets and actionpack to try and narrow down the issue, without any success so far.

I notice that the commit warns that it May not correctly work with src_file lists that include files not provided via the asset pipeline. Any idea what might be going wrong?

My jasmine.yml is as follows :

src_files:
  - spec/javascripts/vendor/*.js
  - spec/javascripts/vendor/sinon/*.js
  - spec/javascripts/vendor/sinon/**/*.js
  - spec/javascripts/helpers/*.js
  - spec/javascripts/support/*.js
  - app/assets/javascripts/common/*.js
  - app/assets/javascripts/vendor/*.js
  - app/assets/javascripts/i18n/*.js
  - app/assets/javascripts/models/*.js
  - app/assets/javascripts/collections/*.js
  - app/assets/javascripts/views/*.js

stylesheets:
  - stylesheets/**/*.css

helpers:
  - helpers/**/*.js

spec_files:
  - '**/*[sS]pec.js'
  - '**/*[sS]pec.js.coffee'

src_dir:

spec_dir: spec/javascripts

"Uncaught TypeError: Cannot call method 'complete' of undefined" When running Jasmine with no spec files

When starting with a fresh rails 3.1 project running jasmine-core (1.2.0.rc1) from master with no jasmine spec files, causes a JavaScript exception in the jasmine.HtmlReporter object at line 87 of jasmine-html.js. This caused me to debug my project configuration, until I added a single spec file with a pending spec.

Here are the contents of the file:

describe("pending", function(){
it("should be pending", function(){

});
});

Jasmine expects at least one "it" function or it blows up. The exception should either be nicer, or preferably it should degrade nicely to a 0 of 0 specs run report. I may patch this, but for now a single spec file with a spec is the workaround.

Jasmine 1.2.0.rc1 + Rails 3.1.1 throws on 'rails generate jasmine'

FWIW, I've given the Jasmine gem (1.2.0.rc1) a go with Rails 3.1.1, but it throws as follows.

>> bundle exec rails generate jasmine 
[WARNING] Could not load generator "generators/jasmine/jasmine_generator" because it's a Rails 2.x generator, which is not supported anymore. Error: uninitialized constant Rails::Generator.
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/bundler/gems/jasmine-gem-5a7524ae9eae/lib/generators/jasmine/jasmine_generator.rb:1:in `<top (required)>'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:297:in `block (2 levels) in lookup'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:293:in `each'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:293:in `block in lookup'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:292:in `each'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:292:in `lookup'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:149:in `find_by_namespace'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/generators.rb:166:in `invoke'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/commands/generate.rb:12:in `<top (required)>'
/Users/whitley/.rvm/gems/ruby-1.9.2-p290@bam/gems/railties-3.1.1/lib/rails/commands.rb:28:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Could not find generator jasmine.

This is with a newly generated Rails 3.1.1 app, using the following Gemfile:

source 'http://rubygems.org'

# TEMP FIX for "warning: already initialized constant WFKV_" in rack 1.3.4
# http://stackoverflow.com/questions/7624661/rake-already-initialized-constant-warning
gem 'rack', '1.3.3'

gem 'rails', '3.1.1'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

group :test do
  # Using jasmine's git master because the gem hasn't been updated for 
  # Rails 3/RSpec 2 yet.
  gem 'jasmine', '1.2.0.rc1', git: "https://github.com/pivotal/jasmine-gem.git", ref: '1.2.rc1'
end

[bug] raised conflicts

yanoo@kelemen ~ $ jasmine init
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1615:in `raise_if_conflicts': Unable to activate actionpack-3.0.9, because rack-1.3.2 conflicts with rack (~> 1.2.1) (Gem::LoadError)
    from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:738:in `activate'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:764:in `block in activate_dependencies'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:758:in `each'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:758:in `activate_dependencies'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:742:in `activate'
    from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:209:in `rescue in try_activate'
    from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:206:in `try_activate'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `rescue in require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/jasmine-1.1.0.rc3/lib/jasmine/railtie.rb:1:in `<top (required)>'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/jasmine-1.1.0.rc3/lib/jasmine.rb:12:in `<top (required)>'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/jasmine-1.1.0.rc3/bin/jasmine:4:in `<top (required)>'
    from /usr/bin/jasmine:19:in `load'

Debian, ruby1.9.2, rubygems 1.8.6

Rake tasks fail in Rails 3.x Engines

The following trace occurs when trying to run rake from a Rails Engine that only includes rails/engine and not all of Rails.

undefined method `version' for Rails:Module
gems/jasmine-1.1.0/lib/jasmine/base.rb:49:in `rails3?' 
gems/jasmine-1.1.0/lib/jasmine.rb:12

This happens because of this check in lib/jasmine/base.rb:

return Rails.version.split(".").first.to_i == 3 if defined? Rails

There is no version method defined on Rails unless you include 'rails' which is overkill for an engine. Changing to the following fixes the issue and I'll drop a pull request shortly:

return Rails::VERSION::MAJOR.to_i === 3 if defined? Rails::VERSION

Jasmine.yml is parsed and loaded multiple times

Each time YamlConfigParser uses its loaded_yaml method, the whole jasmine.yml file is read, ERBified and parsed. That a waste of resources and runtime as it's unlikely to change between the start of the spec run and the end.

Any caching of loaded_yaml however must be reset at the start of the spec run, otherwise the config is never reloaded. Given that the lambdas assigned to config.src_files etc. form a closure over theYamlConfigParser instance and they're never reset, something would have to call Jasmine.load_configuration_from_yaml on page loads to invalidate the cache.

AssetExpander returns paths to un-ERB'd JS files - Regression from 1.2.1

When Jasmine::AssetExpander processes an asset such as: - assets/my_dynamic_script.js which corresponds to app/assets/javascripts/my_dynamic_script.js.erb the included source files will have the following script sources:

  • /app/assets/javascripts/my_dynamic_script.js.erb
  • /assets/my_dynamic_script.js

Loading un-ERB'd JS makes the browser cry.

Given that the

  • lib/jasmine/asset_expander.rb:8-17
    def expand(src_dir, src_path)
      pathname = src_path.gsub(/^\/?assets\//, '').gsub(/\.js$/, '')
      bundled_asset = @bundled_asset_factory.call(pathname, 'js')
      return nil unless bundled_asset

      base_asset = "#{bundled_asset.pathname.to_s.gsub(/#{src_dir}/, '')}?body=true"
      bundled_asset.to_a.inject([base_asset]) do |assets, asset|
        assets << "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true"
      end.flatten
    end

Changing lines 13-16 restores the behavior from 1.2.1.

From:

      base_asset = "#{bundled_asset.pathname.to_s.gsub(/#{src_dir}/, '')}?body=true"
      bundled_asset.to_a.inject([base_asset]) do |assets, asset|
        assets << "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true"
      end.flatten

To:

      bundled_asset.to_a.map do |asset|
        "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true"
      end.flatten

From the specs it is not clear what the intention was for including the bundled_asset.pathname in the list of assets.

However given the significant difference in path returned from the individual assets in bundled_asset.to_a vs. bundled_asset.pathname it seems to be "not the right thing".

Sprockets::BundledAsset#logical_path might be a better candidate if this addition to the results of bundled_asset.to_a is indeed needed.

jasmine init installs deprecated jasmine.rake

This is with the 1.1.0 version of the gem; 1.1.1 is broken per #60 so I can't test with it.

Repro steps:

rails new foo
cd foo
echo "gem 'jasmine', '1.1.0'" >> Gemfile
bundle update
jasmine init
rake -T

Expected result: works, no complaints.

Actual result, giant deprecation warning due to jasmine init still installing the now-deprecated lib/tasks/jasmine.rake:

>> rake -T

            You no longer need to have jasmine.rake in your project, as it is now automatically loaded
            from the Jasmine gem. To silence this warning, set "USE_JASMINE_RAKE=true" in your environment
            or remove jasmine.rake.

rake about              # List versions of all Rails frameworks and the environment
rake assets:clean       # Remove compiled assets
[...]

rake jasmine:ci error. Can't run jasmine with Selenium!

I really like jasmine, but I am having this really annoying error no matter what I do every time I try running "rake jasmine:ci". It appears that jasmine does not integrate with Selenium as easily as it's supposed to! I've tried searching for every variant of "jasmine window.eval is not a function" and nothing comes up. Does anyone else get this error. The exact error with part of the stack trace follows:

 Tue Mar 29 00:00:54 -0700 2011 selenium-client received failure from selenium server:
 requested:
 cmd=getEval
 1=try { eval('jsApiReporter && jsApiReporter.started', window); } catch(err) { window.eval('jsApiReporter && jsApiReporter.started'); }
 sessionId=42c16d0791c14c7abf733ec526641f73
 received:
 "ERROR: Threw an exception: window.eval is not a function"
 called from /Library/Ruby/Gems/1.8/gems/jasmine-1.0.1.1/lib/jasmine/selenium_driver.rb:41:in `eval_js'

To date, I have tried:

  • Installing the very latest jasmine gem from github. Didn't work although I did get a different error this time (yay?).

  • Installing the ffi gem (I seem to recall reading about this somewhere and I'm developing on a mac). Unfortunately it had zero effect.

  • Getting the latest versions of all the dependency gems.

  • Creating a new branch from an old version of our codebase and completely reinstalling the jasmine gem to verify that this is indeed a bug in the gem code and not something I did after installing the gem. To summarize, performing these steps exactly in order (with nothing in between) leads to this error for me:

    sudo gem install jasmine
    script/generate jasmine
    rake jasmine:ci
    

Nothing has worked and I'm getting frustrated. At this point, I would love to hear simply that someone else is also having this problem. Thank you.

Gem.available? deprecation warnings with rubygems-1.8.2

With rubygems-1.8.2, I get the following deprecation warnings:

spot:bones(master|3410m) gb$ spork
Using RSpec
Preloading Rails environment
NOTE: Gem.available? is deprecated, use Specification::find_by_name. It will be removed on or after 2011-11-01.
Gem.available? called from /Users/mc/.rvm/gems/ruby-1.9.2-p180/gems/jasmine-1.0.2.0/lib/jasmine.rb:8.
NOTE: Gem.available? is deprecated, use Specification::find_by_name. It will be removed on or after 2011-11-01.
Gem.available? called from /Users/mc/.rvm/gems/ruby-1.9.2-p180/gems/jasmine-1.0.2.0/lib/jasmine/base.rb:64.
Loading Spork.prefork block...
Spork is ready and listening on 8989!

Test passed with `rake jasmine` but not with `rake jasmine:ci`

I run rake jasmine and open http://localhost:8888, all tests are passing.
But then I run rake jasmine:ci and some tests are failing. I don't know what happened. Just update all gems to latest (possible) version recently.

Here is the portion of my Gemfile.lock that I think may be relevant:

specs:
  best_in_place (2.1.0)
    jquery-rails
    rails (~> 3.1)
  capybara (2.0.2)
    mime-types (>= 1.16)
    nokogiri (>= 1.3.3)
    rack (>= 1.0.0)
    rack-test (>= 0.5.4)
    selenium-webdriver (~> 2.0)
    xpath (~> 1.0.0)
  coffee-rails (3.2.2)
    coffee-script (>= 2.2.0)
    railties (~> 3.2.0)
  coffee-script (2.2.0)
    coffee-script-source
    execjs
  coffee-script-source (1.5.0)
  haml (4.0.0)
    tilt
  haml-rails (0.4)
    actionpack (>= 3.1, < 4.1)
    activesupport (>= 3.1, < 4.1)
    haml (>= 3.1, < 4.1)
    railties (>= 3.1, < 4.1)
  jasmine (1.3.1)
    jasmine-core (~> 1.3.1)
    rack (~> 1.0)
    rspec (>= 1.3.1)
    selenium-webdriver (>= 0.1.3)
  jasmine-core (1.3.1)
  jquery-rails (2.2.1)
    railties (>= 3.0, < 5.0)
    thor (>= 0.14, < 2.0)
  nokogiri (1.5.6)
  quiet_assets (1.0.2)
    railties (>= 3.1, < 5.0)
  rspec (2.13.0)
    rspec-core (~> 2.13.0)
    rspec-expectations (~> 2.13.0)
    rspec-mocks (~> 2.13.0)
  rspec-core (2.13.0)
  rspec-expectations (2.13.0)
    diff-lcs (>= 1.1.3, < 2.0)
  rspec-html-matchers (0.4.0)
    nokogiri (>= 1.4.4)
    rspec (>= 2.0.0)
  rspec-mocks (2.13.0)
  rspec-rails (2.13.0)
    actionpack (>= 3.0)
    activesupport (>= 3.0)
    railties (>= 3.0)
    rspec-core (~> 2.13.0)
    rspec-expectations (~> 2.13.0)
    rspec-mocks (~> 2.13.0)
  selenium-webdriver (2.30.0)
    childprocess (>= 0.2.5)
    multi_json (~> 1.0)
    rubyzip
    websocket (~> 1.0.4)
  slim (1.3.6)
    temple (~> 0.5.5)
    tilt (~> 1.3.3)
  sprockets (2.2.2)
    hike (~> 1.2)
    multi_json (~> 1.0)
    rack (~> 1.0)
    tilt (~> 1.1, != 1.3.0)
  uglifier (1.3.0)
    execjs (>= 0.3.0)
    multi_json (~> 1.0, >= 1.0.2)
    raindrops (~> 0.7)
  xpath (1.0.0)
    nokogiri (~> 1.3)

Order of includes is different

There is a very subtle issue with jasmine-gem.

In development mode, the list of javascript files loaded has application.js at the end -- after all the files that it mentions are loaded. In my case, jQuery is loaded before and then the code inside application.js is loaded.

The gem puts application.js at the top followed by the files that it includes.

Application.js is where I put small snippets of code that the entire application uses. This may be a more general problem too. I believe some folks use the digest type feature where one file includes other files more than just with the top application.js file. jquery-ui-rails does this.

In production mode, I believe the order is the same as development mode -- they are just all stuck together in one giant file.

Add README info for generated examples

It would be helpful if you can include a little snippet in the README near the "rails g jasmine:examples" info:

Be sure to add these two lines to your app/assets/application.js file before booting the server with "rake jasmine":

//= require jasmine_examples/Player.js
//= require jasmine_examples/Song.js

no such file to load -- rails/railtie

With bundle exec jasmine init it misses rails/railtie, because in gem list there are rails and railties, but not in bundle.
It looks like Jasmine::Dependencies only checks on gems and not what was required by bundle.

Starting server with rake jasmine gives 'uninitialized constant Jasmine::YAML'

Steps:

  1. gem install jasmine
  2. jasmine init
  3. rake jasmine
uninitialized constant Jasmine::YAML
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/config.rb:69:in `block in load_configuration_from_yaml'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/yaml_config_parser.rb:51:in `call'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/yaml_config_parser.rb:51:in `loaded_yaml'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/yaml_config_parser.rb:21:in `jasmine_dir'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/config.rb:73:in `block in load_configuration_from_yaml'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/config.rb:4:in `call'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/config.rb:4:in `configure'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/config.rb:72:in `load_configuration_from_yaml'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.3.1/lib/jasmine/tasks/jasmine.rake:48:in `block (2 levels) in <top (required)>'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:227:in `block in execute'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/pivotal/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:187:in `block in invoke_prerequisites'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:185:in `each'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:185:in `invoke_prerequisites'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:165:in `block in invoke_with_call_chain'
/Users/pivotal/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:141:in `invoke_task'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:99:in `block (2 levels) in top_level'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:99:in `each'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:99:in `block in top_level'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:108:in `run_with_threads'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:93:in `top_level'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:71:in `block in run'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.2/bin/rake:37:in `<top (required)>'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `load'
/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `<main>'
Tasks: TOP => jasmine => jasmine:server

Can't run rake tasks using "rake -T"

I forked this gem and tried running the rake -T command, but was halted with the error below:

rake aborted!
You cannot specify the same gem twice with different version requirements. You specified: rspec (>= 1.3.1) and rspec (>= 2.5.0)
/Users/Paintdexter/ruby/jasmine-gem/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

So I uncommented the line below in the jasmine.gemspec file:
#s.add_dependency 'rspec', '>= 1.3.1'
I retried running the same command, but this time it complained about rack:

rake aborted!
You cannot specify the same gem twice with different version requirements. You specified: rack (>= 1.1) and rack (>= 1.2.1)
/Users/Paintdexter/ruby/jasmine-gem/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

So I did the same thing and commented the line below:
#s.add_dependency 'rack', '>= 1.1'

I ran the rake -T command again, but this time I got this:

Could not find gem 'ci_reporter (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
/Users/Paintdexter/ruby/jasmine-gem/Rakefile:4:in `<top (required)>'

At this point, I got stumped. The rubygems hosting website does have the ci_reporter gem. For some reason, the jasmine-gem can't find it.

Two questions:

  1. Any ideas why it can't find the ci_reporter gem?
  2. Any ideas why I'm getting the errors about dependencies?

Firebug causes problems

This is odd. When I enable firebug and reload the jamine test page, firefox just spins and spins and never renders the page. If I disable firebug, no problem. I can go back and forth between these two states.

This is a fresh set up. I was just getting my feet wet with Jasmine. My jamine.yml file is unchanged. Running Rails 3.2.8. FF 17.0.1, Firebug 1.11.1. My test is simply:

describe("UpdAparDef", function() {
it("should always be true", function() {
    expect(true).toBeTruthy;
});
});

I removed all my console.log calls (they were not being called anyway.)

I'm not too sure even how to track this down.

Change folders structure in a non-rails project

Hi

I cannot understand how to change jasmine-gem default folders structure. For example: "public/javascripts" should be "js" and "spec" should be "protected/tests"

I've tried with

Jasmine.configure do |config|
  config.spec_dir = "protected/tests"  #for instance
end

but it didn't work. Thanks :)

Having both rails 2.x and 3.x gems installed causes issues

If Rails 2.x and Rails 3.x are in the gemset of a 2.x application, jasmine will throw the following error when attempting to startup

jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine

Digging into that, the actual exception is:

no such file to load -- rails/railtie

Problem comes down to how it's checking for Rails 3. We're just checking for the existence of the gem, not that we're actually running Rails 3.x

def rails3?
   safe_gem_check("rails", ">= 3.0")
end

...

private
def safe_gem_check(gem_name, version_string)
  if Gem::Specification.respond_to?(:find_by_name)
    Gem::Specification.find_by_name(gem_name, version_string)
  elsif Gem.respond_to?(:available?)
    Gem.available?(gem_name, version_string)
  end
rescue Gem::LoadError
  false
end

Seems like we should check the Rails version along with checking that the gem is installed.

Getting 404 for my application.js manifest file

I can't find any documentation on using manifest files, but the issue src_files not loading in v1.2.1 seems to imply that you can simply put the following in your jasmine.yml and it will work:

src_files:
  - 'assets/application.js'

But that just gives me a 404. I found a references to rails_3_asset_pipeline in the gem code, and just for kicks I thought I'd try modifying lib/jasmine/dependencies.rb and returning true for that block, and it just made my test suite page die with "Internal server error", and the server console spitting out "!! Unexpected error while processing request: undefined method `context_class' for nil:NilClass".

Any thoughts? Or is the current advise to use jasmine rice, or jasmine-rails?

Edit: btw everything works fine if I directly reference all the files e.g.

src_files:
  - 'vendor/assets/javascrips/jquery.js'
  - 'vendor/assets/javascrips/underscore.js'
  - 'vendor/assets/javascrips/backbone.js'
  - 'app/assets/javascrips/**/*.js'

Under RSpec 2.11.0, rake jasmine:ci throws error when reporting.

.../gems/jasmine-gem-ddeb56597c35/lib/jasmine/spec_builder.rb:93:in `declare_suite': undefined method `describe' for #<Jasmine::SpecBuilder:0x007ff77befaec8> (NoMethodError)
.../gems/jasmine-gem-ddeb56597c35/lib/jasmine/spec_builder.rb:87:in `block in declare_suites'
.../gems/jasmine-gem-ddeb56597c35/lib/jasmine/spec_builder.rb:86:in `each'

Seems to be that rspec 2.11 changes 'what' object they define should, should_not, it, and describe on. Namely the change to BasicObject from Kernel.

rake jasmine:ci fails in Firefox 4 (same as issue #27)

This is the same problem I was having in issue 27. I'm simply creating a new issue because Rajan accidentally closed the other issue. Please see issue #27 and the corresponding comments for more detailed information about the problem.

 rake jasmine:ci

doesn't work when using Firefox 4. One possible solution is to downgrade. Another solution is to try using chrome instead, although after trying to set the JASMINE_BROWSER variable, I was unsuccessful in getting chrome to load and run the Selenium tests.

Rajan, if you see this, please let me know if you'd like me to copy and paste my comments from issue 27 for reference.

Firefox profile jasmine:ci

I am using jscoverage proxy server for coverage reports. The new jasmine with webdriver does not allow me to use a custom profile (due to a bug in selenium server as well).

Please include support for proxy parameters or the ability to set a custom profile.

Here is some quick code that I threw together in selenium_driver.rb to add a proxy address. I don't know much about the webdriver stuff so, someone could probably do better.

caps = if ENV['SELENIUM_FIREFOX_PROXY']
Selenium::WebDriver::Remote::Capabilities.firefox(:proxy =>
Selenium::WebDriver::Proxy.new(:http =>
ENV['SELENIUM_FIREFOX_PROXY']))
else
Selenium::WebDriver::Remote::Capabilities.firefox()
end

  @driver = if selenium_server
    Selenium::WebDriver.for :remote, :url =>

selenium_server, :desired_capabilities => caps
else
Selenium::WebDriver.for browser.to_sym
end
@http_address = http_address
end

sample tests all fail

I'm getting the following error multiple times when trying to run rake jasmine and the sample tests:

TypeError: Player is not a constructor in http://localhost:8888/**spec**/PlayerSpec.js (line 6)
([object Object])@http://localhost:8888/**JASMINE_ROOT**/lib/jasmine.js:94 ([object Error])@http://localhost:8888/**JASMINE_ROOT**/lib/jasmine.js:1965 ((function () {if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {completedSynchronously = true;return;}if (self.blocks[self.index].abort) {self.abort = true;}self.offset = 0;self.index++;var now = (new Date).getTime();if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {self.env.lastUpdate = now;self.env.setTimeout(function () {self.next_();}, 0);} else {if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {goAgain = true;} else {self.next_();}}}))@http://localhost:8888/**JASMINE_ROOT**/lib/jasmine.js:970 ()@http://localhost:8888/**JASMINE_ROOT**/lib/jasmine.js:1739

It appears that Jasmine can find the sample Javascripts, but can't call new Player() successfully.

Here is my jasmine.yml

src_files

Return an array of filepaths relative to src_dir to include before jasmine specs.

Default: []

EXAMPLE:

src_files:

- lib/source1.js

- lib/source2.js

- dist/*/.js

src_files:

  • public/javascripts/prototype.js
  • public/javascripts/effects.js
  • public/javascripts/controls.js
  • public/javascripts/dragdrop.js
  • public/javascripts/application.js
  • public/javascripts/*/.js

stylesheets

Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.

Default: []

EXAMPLE:

stylesheets:

- css/style.css

- stylesheets/*.css

stylesheets:

  • stylesheets/*/.css

helpers

Return an array of filepaths relative to spec_dir to include before jasmine specs.

Default: ["helpers/*/.js"]

EXAMPLE:

helpers:

- helpers/*/.js

helpers:

  • helpers/*/.js

spec_files

Return an array of filepaths relative to spec_dir to include.

Default: ["*/[sS]pec.js"]

EXAMPLE:

spec_files:

- */[sS]pec.js

spec_files:

  • */[sS]pec.js

src_dir

Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.

Default: project root

EXAMPLE:

src_dir: public

src_dir:

spec_dir

Spec directory path. Your spec_files must be returned relative to this path.

Default: spec/javascripts

EXAMPLE:

spec_dir: spec/javascripts

spec_dir: spec/javascripts

I'm running Rails 2.4, REE on OS X 10.6.7 with Firefox 4 and Safari 5.0.5. I get the same errors in both browsers. Chrome is a whole different beast.

Jasmine server doesn't exit on Ctrl-C

% bundle exec rake jasmine
your tests are here:
  http://localhost:8888/
[2012-09-08 12:59:52] INFO  WEBrick 1.3.1
[2012-09-08 12:59:52] INFO  ruby 1.8.7 (2012-02-08) [universal-darwin12.0]
[2012-09-08 12:59:52] INFO  WEBrick::HTTPServer#start: pid=17646 port=8888
^C[2012-09-08 13:00:59] ERROR Interrupt: 
        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:91:in `select'
^C[2012-09-08 13:01:00] ERROR Interrupt: 
        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:91:in `select'

Seems like a similar Ctrl-C issue that was reported 2 years ago, but I'm with rack 1.4.1 on OS X Mountain Lion with stock Ruby 1.8.7.

This problem is not under the Jasmine 1.2.0 gem

Allow rack middleware to be added for src files

I want to pre-process my js files before testing them. In my case I'm instrumenting them to test code coverage (though I guess this would be relevant for converting coffeescript etc.).

I looked into supporting a coverage: option to the jasmine config in the way that pull request #37 does, though I came to the conclusion that a simpler and more generic way to do this would be to pass my js through a rack middleware to convert it.

Having read the email thread about supporting coverage - I think this approach could open up a lot of possibilities for jasmine without needing the core to maintain it. Could this be a potential feature? Is there already a plan for something along these lines?

rails3 dependency required but not listed?

Installed gem for a Sinatra project, ran bundle install, then ran "jasmine init" and got:

$ jasmine init
/Users/robby/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find rails (>= 3.0) amongst [bundler-1.0.18, childprocess-0.2.2, diff-lcs-1.1.3, ffi-1.0.9, jasmine-1.1.0, jasmine-core-1.1.0, json_pure-1.6.1, nokogiri-1.5.0, rack-1.3.3, rack-test-0.6.1, rake-0.9.2, redis-2.2.2, rspec-2.6.0, rspec-core-2.6.4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, rubyzip-0.9.4, selenium-webdriver-2.6.0, shoulda-2.11.3, sinatra-1.2.6, tilt-1.3.3] (Gem::LoadError) from /Users/robby/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:into_spec'
from /Users/robby/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:434:in find_by_name' from /Users/robby/.rvm/gems/ruby-1.9.2-p290@dough/gems/jasmine-1.1.0/lib/jasmine/base.rb:51:inrails3?'
from /Users/robby/.rvm/gems/ruby-1.9.2-p290@dough/gems/jasmine-1.1.0/lib/jasmine.rb:12:in <top (required)>' from /Users/robby/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /Users/robby/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/robby/.rvm/gems/ruby-1.9.2-p290@dough/gems/jasmine-1.1.0/bin/jasmine:4:in<top (required)>'
from /Users/robby/.rvm/gems/ruby-1.9.2-p290@dough/bin/jasmine:19:in load' from /Users/robby/.rvm/gems/ruby-1.9.2-p290@dough/bin/jasmine:19:in

'

For reference:
$ gem list
*** LOCAL GEMS ***

bundler (1.0.18)
childprocess (0.2.2)
diff-lcs (1.1.3)
ffi (1.0.9)
jasmine (1.1.0)
jasmine-core (1.1.0)
json_pure (1.6.1)
nokogiri (1.5.0)
rack (1.3.3)
rack-test (0.6.1)
rake (0.9.2)
redis (2.2.2)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
rubyzip (0.9.4)
selenium-webdriver (2.6.0)
shoulda (2.11.3)
sinatra (1.2.6)
tilt (1.3.3)

bundle install from jasmine-gem source code hangs after getting "tenderlove-frex", "spicycode-rcov"

Cannot get bundle install to work with the jasmine-rails source code. It hangs while downloading dependencies.

Using rvm 1.9.3, I'm using an clean/new gemset when doing bundle install, and when running it in verbose:

$ rvm --default 1.9.3
$ rvm gemset create jasmine
$ rvm gemset use jasmine
$ bundle install --verbose

It get's stuck on (hangs at that last line):

Query List: ["termios"]
Query Gemcutter Dependency Endpoint API: termios
Fetching from: http://rubygems.org/api/v1/dependencies?gems=termios
HTTP Success
Query List: []
Unmet Dependencies: ["tenderlove-frex", "spicycode-rcov"]
Fetching gem metadata from http://rubygems.org/
Query List: ["tenderlove-frex", "spicycode-rcov"]
Query Gemcutter Dependency Endpoint API: tenderlove-frex spicycode-rcov
Fetching from: http://rubygems.org/api/v1/dependencies?gems=tenderlove- frex,spicycode-rcov
HTTP Success
Query List: []

rake jasmine (1.2.0.rc2) and Rails 3.0.3 complains about assets

rake jasmine:ci works without incident.

Backtrace:

$ rake jasmine --trace
** Invoke jasmine (first_time)
** Invoke jasmine:server (first_time)
** Invoke jasmine:require (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute jasmine:require
** Execute jasmine:server
your tests are here:
http://localhost:8888/
rake aborted!
undefined method assets' for #<Example::Application:0x1056d6c98> /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bundler/gems/jasmine-gem-953d17dff4b4/lib/jasmine/dependencies.rb:18:inrails_3_asset_pipeline?'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bundler/gems/jasmine-gem-953d17dff4b4/lib/jasmine/server.rb:77:in app' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rack-1.2.2/lib/rack/builder.rb:46:ininstance_eval'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rack-1.2.2/lib/rack/builder.rb:46:in initialize' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rack-1.2.2/lib/rack/builder.rb:50:innew'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rack-1.2.2/lib/rack/builder.rb:50:in app' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bundler/gems/jasmine-gem-953d17dff4b4/lib/jasmine/server.rb:75:inapp'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bundler/gems/jasmine-gem-953d17dff4b4/lib/jasmine/config.rb:20:in start_server' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bundler/gems/jasmine-gem-953d17dff4b4/lib/jasmine/tasks/jasmine.rake:48 /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:205:incall'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:205:in execute' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:200:ineach'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:200:in execute' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:158:ininvoke_with_call_chain'
/Users/pivotal/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/monitor.rb:242:in synchronize' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:151:ininvoke_with_call_chain'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:176:in invoke_prerequisites' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:174:ineach'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:174:in invoke_prerequisites' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:157:ininvoke_with_call_chain'
/Users/pivotal/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/monitor.rb:242:in synchronize' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:151:ininvoke_with_call_chain'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/task.rb:144:in invoke' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:112:ininvoke_task'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:90:in top_level' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:90:ineach'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:90:in top_level' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:129:instandard_exception_handling'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:84:in top_level' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:62:inrun'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:129:in standard_exception_handling' /Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/lib/rake/application.rb:59:inrun'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/gems/rake-0.9.2/bin/rake:32
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bin/rake:19:in `load'
/Users/pivotal/.rvm/gems/ree-1.8.7-2011.03@gemset/bin/rake:19
Tasks: TOP => jasmine => jasmine:server

jasmine:ci throwing "invalid byte sequence in US-ASCII"

I have a spec with some UTF-8 characters that looks like that:

it('should display a message for expired poll', function() {
  startCountdown(fakeClock(true), dom);
  expect(dom.message().val()).toBe('Votação encerrada.');
});

When I run $ bundle exec rake jasmine:ci the output looks like this:

/Users/vgomes/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec /Users/vgomes/codes/jasmine-gem/lib/jasmine/runner.rb --colour --format progress
/Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:40:in `match': invalid byte sequence in US-ASCII (ArgumentError)
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:40:in `block (3 levels) in guess_example_locations'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:39:in `each'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:39:in `block (2 levels) in guess_example_locations'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:38:in `open'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:38:in `block in guess_example_locations'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:36:in `each'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:36:in `guess_example_locations'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/spec_builder.rb:16:in `start'
    from /Users/vgomes/codes/jasmine-gem/lib/jasmine/runner.rb:30:in `<top (required)>'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
    from /Users/vgomes/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!
/Users/vgomes/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec /Users/vgomes/codes/jasmine-gem/lib/jasmine/runner.rb --colour --format progress failed

Tasks: TOP => jasmine_continuous_integration_runner
(See full trace by running task with --trace)

As you can see, I'm running on Ruby 1.9.3-p194. Does anyone know how I can make this work? I have already tried to add # encoding: UTF-8 in the spec_builder.rb but it didn't fix the problem. (sorry if the issue was already adressed.)

'No data received' from http://localhost:8888/

When I run bundle exec rake jasmine then browse to http://localhost:8888/ I see the following error message:

No data received
Unable to load the web page because the server sent no data.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

In the console, I see:

[2012-02-08 07:54:08] INFO  WEBrick 1.3.1
[2012-02-08 07:54:08] INFO  ruby 1.9.2 (2011-07-09) [i686-linux]
[2012-02-08 07:54:08] WARN  TCPServer Error: Address already in use - bind(2)
[2012-02-08 07:54:08] INFO  WEBrick::HTTPServer#start: pid=12078 port=8888
[2012-02-08 07:54:10] ERROR ArgumentError: wrong number of arguments (2 for 0)
        /home/duncan/.rvm/gems/ruby-1.9.2-p290/gems/railroady-1.0.6/tasks/railroady.rake:11:in `format'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:110:in `service'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
[2012-02-08 07:54:10] ERROR ArgumentError: wrong number of arguments (3 for 0)
        /home/duncan/.rvm/gems/ruby-1.9.2-p290/gems/railroady-1.0.6/tasks/railroady.rake:11:in `format'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpversion.rb:46:in `to_s'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpresponse.rb:49:in `status_line'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpresponse.rb:170:in `send_header'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpresponse.rb:102:in `send_response'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:86:in `run'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

The structure of the spec/javascripts directory is:

spec/javascripts/
├── helpers
│   ├── jasmine_helpers.js.coffee
│   ├── jasmine-jquery-1.3.1.js
│   └── mock-ajax.js
├── models
│   ├── account_spec.js.coffee
│   ├── matrices_spec.js.coffee
│   ├── matrix_spec.js.coffee
│   └── students_spec.js.coffee
├── support
│   ├── jasmine_config.rb
│   ├── jasmine_runner.rb
│   └── jasmine.yml
└── views
    ├── avia_view_spec.js.coffee
    ├── matrices_view_spec.js.coffee
    ├── students_view_spec.js.coffee
    └── student_view_spec.js.coffee

My jasmine.yml file contains:

src_dir: app/assets/javascripts

asset_paths:
  - app/assets/javascripts/views

src_files:
  - avia.js
  - jquery-1.6.4.js
  - jquery.jqGrid.min.js
  - underscore.js
  - backbone.js
  - haml.js
  - "**/*"

stylesheets:
  - stylesheets/**/*.css

helpers:
  - helpers/**/*.js
  - helpers/**/*.js.coffee

spec_files:
  - '**/*_spec.js.coffee'

spec_dir: spec/javascripts

My Gem versions are as follows (I've included what I think are the relevant ones; let me know if you require a full list):

  • coffee-filter (0.1.1)
  • coffee-rails (3.1.1)
  • coffee-script (2.2.0)
  • coffee-script-source (1.2.0)
  • jasmine (1.1.2)
  • jasmine-core (1.1.0)
  • jasmine-headless-webkit (0.9.0.rc1 4f11cba)
  • jasmine-rails (0.0.2)
  • railroady (1.0.6)
  • rails (3.1.0)
  • rake (0.9.2.2)
  • sprockets (2.0.3)
  • therubyracer (0.9.9)

I'm running Chrome 16.0.912.77 on Linux Mint 12, using Ruby 1.9.2-p290 through RVM.

This setup works fine through jasmine-headless-webkit:

Running Jasmine specs...
............................
PASS: 28 tests, 0 failures, 0.076 secs.

Perhaps I'm doing something in my jasmine.yml that isn't supported by jasmine-gem?

CSS for hiding #jasmine_content not properly scoped

I am not sure if this belongs here or in the Jasmine core project.

The problem is that the run.html.erb file has the #jasmine_content div placed outside the #HTMLReporter div. This prevents the styling that pushes the #jasmine_content div offscreen because the CSS rule looks like this:

#HTMLReporter #jasmine_content {
  position: fixed;
  right: 100%;
}

The CSS rule either needs to not be scoped around #HTMLReporter or the jasmine.HtmlReporter createReporterDom function needs to also create the #jasmine_content div.

I would be happy to fix the issue but I am not sure where to write a patch.

jasmine:ci rake task doesn't return non zero exit code if exception occurs outside of tests

I had a situation where our CI server ran the jasmine:ci rake task and we got output like this:

>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:55535, CTRL+C to stop
Waiting for jasmine server on 55535...
jasmine server started.
Waiting for suite to finish in browser ...
/Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout::Error (Timeout::Error)
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1293:in `request'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/newrelic_rpm-3.5.6.42.beta/lib/new_relic/agent/instrumentation/net.rb:22:in `block in request_with_newrelic_trace'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/newrelic_rpm-3.5.6.42.beta/lib/new_relic/agent/method_tracer.rb:240:in `trace_execution_scoped'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/newrelic_rpm-3.5.6.42.beta/lib/new_relic/agent/instrumentation/net.rb:21:in `request_with_newrelic_trace'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:745:in `start'
    from /Users/Admin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1284:in `request'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/newrelic_rpm-3.5.6.42.beta/lib/new_relic/agent/instrumentation/net.rb:22:in `block in request_with_newrelic_trace'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/newrelic_rpm-3.5.6.42.beta/lib/new_relic/agent/method_tracer.rb:240:in `trace_execution_scoped'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/newrelic_rpm-3.5.6.42.beta/lib/new_relic/agent/instrumentation/net.rb:21:in `request_with_newrelic_trace'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/default.rb:81:in `response_for'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/default.rb:43:in `request'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/bridge.rb:598:in `raw_execute'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/bridge.rb:576:in `execute'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/bridge.rb:322:in `executeScript'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/common/driver.rb:211:in `execute_script'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/jasmine-1.2.1/lib/jasmine/selenium_driver.rb:33:in `eval_js'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/jasmine-1.2.1/lib/jasmine/runners/http.rb:61:in `eval_js'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/jasmine-1.2.1/lib/jasmine/runners/http.rb:55:in `wait_for_suites_to_finish_running'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/jasmine-1.2.1/lib/jasmine/runners/http.rb:14:in `run'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/jasmine-1.2.1/lib/jasmine/run_specs.rb:30:in `<top (required)>'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:77:in `rescue in run'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:73:in `run'
    from /Users/Admin/.rvm/gems/ruby-1.9.3-p327@handl-server/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `block in autorun'

As you can see, there was a Timeout::Error for some reason outside of the test runs themselves, but this process ended with an exit status of 0. This caused our CI process to think the jasmine tests succeeded when they in fact didn't.

Javascript source files not found in assets directory.

I might get to the bottom of the reason but when using the jasmine gem I'm having issues picking up javascript source files inside the assets directory. They are picked up fine if they are in the public directory:

src_dir: public/javascripts
src_files:

  • '*/.js'

But if I change the src_dir/src_files to allow Jasmine to pick them up from the app/assets/javascripts dirctory it consistenly fails to find them.

Jasmine Gem doesn't work with rspec 2.11.x

RSpec 2.11.0 removes the monkey patch of describe on all objects:

  • Limit monkey patching of describe onto just the objects that need it rather than every object in the system (Myron Marston).

Here's the stacktrace when calling 'rake jasmine:ci'

/Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.0/lib/jasmine/spec_builder.rb:93:in declare_suite': undefined methoddescribe' for #Jasmine::SpecBuilder:0x007fb8e3d09820 (NoMethodError)
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.0/lib/jasmine/spec_builder.rb:87:in block in declare_suites' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.0/lib/jasmine/spec_builder.rb:86:ineach'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.0/lib/jasmine/spec_builder.rb:86:in declare_suites' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.0/lib/jasmine/runner.rb:32:in<top (required)>'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in load' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:inblock in load'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in load_dependency' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:inload'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in block in load_spec_files' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:inmap'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in load_spec_files' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:inrun'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in run' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:inblock in autorun'
rake aborted!

jasmine init returns 'could not find rails <>= 3.0> amongst...'

Hello,
I just gem installed jasmine, went to init a new project and ran jasmine init but got an error message saying:
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': could not find rails <>= 3.0> amongst [a list of all my gems] <Gem::LoadError> from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in
to_spec'
from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:427:i
n find_by_name' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/jasmine-1.1.0/lib/jasmine/base. rb:51:inrails3?'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/jasmine-1.1.0/lib/jasmine.rb:12
:in <top (required)>' from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:i nrequire'
from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:i
n require' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/jasmine-1.1.0/bin/jasmine:4:in <top (required)>'
from c:/Ruby192/bin/jasmine:19:in load' from c:/Ruby192/bin/jasmine:19:in

'

Will try to have a look into it later on today, if no one else beats me to it.
I presume that might be a bug since jasmine init isn't supposed to have any dependency on rails, correct?

PS- also tried to update v.1.1.0 to v. 1.1.0.rc4 and got the same error.

Gem does not have a lockdown on jasmine-core version

Had a big melt down today on my IE build

2 errors that prevent window from loading up at all

(http://i.imgur.com/Yp7Ns.jpg)

Expected identifie, string or number jasmine-html.js

and

'jasmine.TrivilaReporter.prototype' is null or not an object.

this was strange since no one touched these files in more than 6 months. Further investigations showed that these boxes had re-installed the jasmine gem.

Now, my gemfile has "gem 'jasmine', '1.2.1' " and so does the lock file, but i noticed that jasmine-gem has a dependency on "jasmine-core >= 1.2.0"

http://i.imgur.com/jnG2r.jpg

So, since the update of the core to 1.3.0 something is no longer compatible, i had to lock down jasmine-core in the gemfile and manually manage that dependency to fix the issue.

Figured I'd give you guys a heads up.

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.