Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rails generators. Add sources.yaml support. Fix Prototype.js coll…
…ision on jasmine:ci. Version bump to 0.4.0.
- Loading branch information
Showing
24 changed files
with
263 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,5 @@ | |||
--- | --- | ||
:minor: 1 | :patch: 0 | ||
:build: | |||
:patch: 3 | |||
:major: 0 | :major: 0 | ||
:build: | |||
:minor: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
class JasmineGenerator < Rails::Generator::Base | |||
def manifest | |||
record do |m| | |||
|
|||
m.directory "spec/javascripts" | |||
m.file "spec/javascripts/SpecHelper.js", "spec/javascripts/SpecHelper.js" | |||
m.file "spec/javascripts/ExampleSpec.js", "spec/javascripts/ExampleSpec.js" | |||
|
|||
m.directory "spec/javascripts/support" | |||
m.file "spec/javascripts/support/jasmine_config.rb", "spec/javascripts/support/jasmine_config.rb" | |||
m.file "spec/javascripts/support/jasmine_spec.rb", "spec/javascripts/support/jasmine_spec.rb" | |||
m.file "spec/javascripts/support/sources-rails.yaml", "spec/javascripts/support/sources.yaml" | |||
|
|||
m.directory "lib/tasks" | |||
m.file "lib/tasks/jasmine.rake", "lib/tasks/jasmine.rake" | |||
|
|||
m.readme "INSTALL" | |||
end | |||
end | |||
|
|||
def file_name | |||
"create_blog" | |||
end | |||
|
|||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
Jasmine has been installed with example specs. | |||
|
|||
To run the server: | |||
|
|||
rake jasmine | |||
|
|||
To run the automated CI task with Selenium: | |||
|
|||
rake jasmine:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
namespace :jasmine do | |||
require 'jasmine' | |||
|
|||
desc "Run continuous integration tests" | |||
require "spec" | |||
require 'spec/rake/spectask' | |||
Spec::Rake::SpecTask.new(:ci) do |t| | |||
t.spec_opts = ["--color", "--format", "specdoc"] | |||
t.verbose = true | |||
t.spec_files = ['spec/javascripts/support/jasmine_spec.rb'] | |||
end | |||
task :server do | |||
require 'spec/javascripts/support/jasmine_config' | |||
|
|||
puts "your tests are here:" | |||
puts " http://localhost:8888/run.html" | |||
|
|||
Jasmine::Config.new.start_server | |||
end | |||
end | |||
|
|||
desc "Run specs via server" | |||
task :jasmine => ['jasmine:server'] |
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
generators/jasmine/templates/spec/javascripts/support/jasmine_config.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
require 'jasmine' | |||
|
|||
class Jasmine::Config | |||
|
|||
def project_root | |||
File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..")) | |||
end | |||
|
|||
# Return an array of files to include before jasmine specs. Override if needed. | |||
# def src_files | |||
# match_files(src_dir, "**/*.js") | |||
# end | |||
|
|||
# Path to your JavaScript source files | |||
# def src_dir | |||
# File.join(project_root, "public") | |||
# end | |||
|
|||
# Path to your JavaScript specs | |||
# def spec_dir | |||
# File.join(project_root, 'spec/javascripts') | |||
# end | |||
end |
17 changes: 17 additions & 0 deletions
17
generators/jasmine/templates/spec/javascripts/support/jasmine_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
require 'rubygems' | |||
require File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config')) | |||
|
|||
jasmine_config = Jasmine::Config.new | |||
spec_builder = Jasmine::SpecBuilder.new(jasmine_config) | |||
|
|||
should_stop = false | |||
|
|||
Spec::Runner.configure do |config| | |||
config.after(:suite) do | |||
spec_builder.stop if should_stop | |||
end | |||
end | |||
|
|||
spec_builder.start | |||
should_stop = true | |||
spec_builder.declare_suites |
8 changes: 8 additions & 0 deletions
8
generators/jasmine/templates/spec/javascripts/support/sources-rails.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
sources: | |||
- javascripts/prototype.js | |||
- javascripts/effects.js | |||
- javascripts/controls.js | |||
- javascripts/dragdrop.js | |||
- javascripts/application.js | |||
src_dir: public | |||
spec_dir: spec/javascripts |
5 changes: 5 additions & 0 deletions
5
generators/jasmine/templates/spec/javascripts/support/sources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
#sources: | |||
# - lib/source1.js | |||
# - lib/source2.js | |||
#src_dir: | |||
#spec_dir: spec/javascripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.