Coder Social home page Coder Social logo

jasminerice's Introduction

Jasminerice

Utilizing (jasmine)[http://pivotal.github.com/jasmine/] and taking full advantage of the Rails 3.1 asset pipeline jasmine rice removes any excuse YOU have for not testing your out of control sprawl of coffeescript files. This project rocks and uses MIT-LICENSE.

Setup For Rails 3.1

This is a gem specifically for Rails 3.1. Just include it in your Gemfile so

gem "jasminerice"

Now add a route to the end of your config.routes but only for development and test

if ["development", "test"].include? Rails.env
	mount Jasminerice::Engine => "/jasmine" 
end

Create a single file called

spec/javascripts/spec.js.coffee

with the following content

#=require_tree ./

This pulls in all your

spec/javascripts/*_spec.js.coffee
spec/javascripts/*_spec.js
spec/javascripts/*_spec.js.erb
etc

into jasmine. For example

spec/javascripts/foo.js.coffe

#= require foo
#= require bar

describe "Foo", ->

	it "it is not bar", ->
		v = new Foo()

		expect(v.bar()).toEqual(false)

describe "Bar", ->

	it "it is not foo", ->
		v = new Bar()

		expect(v.foo()).toEqual(false)

The Rails 3.1 asset pipeline using sprockets and tilt ensure conversion. As well you can use the #require dependency mechanisms

Now start your server

rails s

Goto

http://localhost:3000/jasmine

and there are your specs.

Questions:

jasminerice's People

Contributors

bradphelan avatar vivrass avatar

Stargazers

Tim Kevin Oxley avatar

Watchers

Tim Kevin Oxley avatar 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.