Giter VIP home page Giter VIP logo

jasmine-gem's Introduction

The Jasmine Gem Build Status

The Jasmine Ruby Gem is a package of helper code for developing Jasmine projects for Ruby-based web projects (Rails, Sinatra, etc.) or for JavaScript projects where Ruby is a welcome partner. It serves up a project's Jasmine suite in a browser so you can focus on your code instead of manually editing script tags in the Jasmine runner HTML file.

Contents

This gem contains:

  • A small server that builds and executes a Jasmine suite for a project
  • A script that sets up a project to use the Jasmine gem's server
  • Generators for Ruby on Rails projects (Rails 3 and Rails 4)

You can get all of this by: gem install jasmine or by adding Jasmine to your Gemfile.

group :development, :test do
  gem 'jasmine'
end

Init A Project

To initialize a project for Jasmine

rails g jasmine:install rails g jasmine:examples

For any other project (Sinatra, Merb, or something we don't yet know about) use

jasmine init jasmine examples

Usage

Start the Jasmine server:

rake jasmine

Point your browser to localhost:8888. The suite will run every time this page is re-loaded.

For Continuous Integration environments, add this task to the project build steps:

rake jasmine:ci

This uses PhantomJS to load and run the Jasmine suite.

Please note that PhantomJS will be auto-installed by the phantomjs-gem at the first rake jasmine:ci run. If you have a PhantomJS somewhere on your path, it won't install.

Configuration

Customize spec/javascripts/support/jasmine.yml to enumerate the source files, stylesheets, and spec files you would like the Jasmine runner to include. You may use dir glob strings.

Alternatively, you may specify the path to your jasmine.yml by setting an environment variable:

rake jasmine:ci JASMINE_CONFIG_PATH=relative/path/to/your/jasmine.yml

In addition, the spec_helper key in your jasmine.yml specifies the path to a ruby file that can do programmatic configuration. After running jasmine init or rails g jasmine:install it will point to spec/javascripts/support/jasmine_helper.rb which you can modify to fit your needs.

Running Jasmine on a different port

The ports that rake jasmine (or rake jasmine:server) and rake jasmine:ci run on are configured independently, so they can both run at the same time.

To change the port that rake jasmine uses:

In your jasmine_helper.rb:

Jasmine.configure do |config|
   config.server_port = 5555
end

By default rake jasmine:ci will attempt to find a random open port, to set the port that rake jasmine:ci uses:

In your jasmine_helper.rb:

Jasmine.configure do |config|
   config.ci_port = 1234
end

Support

Jasmine Mailing list: [email protected] Twitter: @jasminebdd

Please file issues here at Github

Copyright (c) 2008-2013 Pivotal Labs. This software is licensed under the MIT License.

jasmine-gem's People

Contributors

ragaskar avatar xian avatar heythisisnate avatar sheelc avatar pivotalops avatar jboyens avatar jvortmann avatar moll avatar mcolyer avatar shiftb avatar thewoolleyman avatar thedeeno avatar dburkes avatar iainbeeston avatar mainej avatar jasonm avatar jedschneider avatar jkeen avatar kmayer avatar kozy4324 avatar levent avatar lukeasrodgers avatar dentarg avatar richardiux avatar tooky avatar codebeige avatar tjarratt avatar janv avatar enrapt-mochizuki avatar trungpham avatar

Watchers

James Cloos avatar  avatar

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.