forked from sumitngupta/jasmine-gem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: lib/jasmine/config.rb lib/jasmine/server.rb
- Loading branch information
Showing
66 changed files
with
1,730 additions
and
987 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--color |
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 | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,4 @@ matrix: | |
env: RAILS_VERSION=pojs-rspec2 | ||
allow_failures: | ||
- rvm: rbx | ||
- rvm: jruby |
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 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 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
11 changes: 11 additions & 0 deletions
11
generators/jasmine/templates/spec/javascripts/support/jasmine_helper.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#Use this file to set/override Jasmine configuration options | ||
#You can remove it if you don't need it. | ||
#This file is loaded *after* jasmine.yml is interpreted. | ||
# | ||
#Example: using a different boot file. | ||
#Jasmine.configure do |config| | ||
# config.boot_dir = '/absolute/path/to/boot_dir' | ||
# config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] } | ||
#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 | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ Gem::Specification.new do |s| | |
s.summary = %q{JavaScript BDD framework} | ||
s.description = %q{Test your JavaScript without any framework dependencies, in any environment, and with a nice descriptive syntax.} | ||
s.email = %q{[email protected]} | ||
s.homepage = "http://pivotal.github.com/jasmine" | ||
s.homepage = "http://pivotal.github.com/jasmine/" | ||
s.license = "MIT" | ||
|
||
s.files = `git ls-files`.split("\n") | Dir.glob('jasmine/**/*') | ||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | ||
|
@@ -66,7 +67,9 @@ Gem::Specification.new do |s| | |
s.add_development_dependency 'json_pure' | ||
s.add_development_dependency 'nokogiri' | ||
|
||
s.add_dependency 'jasmine-core', ">= 1.2.0" | ||
s.add_development_dependency 'anchorman' | ||
|
||
s.add_dependency 'jasmine-core', "~> 1.3.1" | ||
s.add_dependency 'rack', '~> 1.0' | ||
s.add_dependency 'rspec', '>= 1.3.1' | ||
s.add_dependency 'selenium-webdriver', '>= 0.1.3' | ||
|
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
11 changes: 11 additions & 0 deletions
11
lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine_helper.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#Use this file to set/override Jasmine configuration options | ||
#You can remove it if you don't need it. | ||
#This file is loaded *after* jasmine.yml is interpreted. | ||
# | ||
#Example: using a different boot file. | ||
#Jasmine.configure do |config| | ||
# @config.boot_dir = '/absolute/path/to/boot_dir' | ||
# @config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] } | ||
#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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'rack' | ||
require 'rack/utils' | ||
require 'jasmine-core' | ||
require 'rack/jasmine/runner' | ||
require 'rack/jasmine/focused_suite' | ||
require 'rack/jasmine/cache_control' | ||
require 'ostruct' | ||
|
||
module Jasmine | ||
class Application | ||
def self.app(config, builder = Rack::Builder.new) | ||
config.rack_apps.each do |(app, config_block)| | ||
builder.use(app, &config_block) | ||
end | ||
config.rack_path_map.each do |path, handler| | ||
builder.map(path) { run handler.call } | ||
end | ||
builder | ||
end | ||
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Jasmine | ||
class AssetExpander | ||
def initialize(bundled_asset_factory, asset_path_for) | ||
@bundled_asset_factory = bundled_asset_factory | ||
@asset_path_for = asset_path_for | ||
end | ||
|
||
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 | ||
|
||
bundled_asset.to_a.map do |asset| | ||
"/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true" | ||
end.flatten | ||
end | ||
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Jasmine | ||
class AssetPipelineMapper | ||
|
||
def initialize(config, asset_expander) | ||
@config = config | ||
@asset_expander = asset_expander | ||
end | ||
|
||
def map_src_paths(src_paths) | ||
src_paths.map do |src_path| | ||
@asset_expander.call(@config.src_dir, src_path) || src_path | ||
end.flatten.uniq | ||
end | ||
|
||
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Jasmine | ||
class AssetPipelineUtility | ||
def self.bundled_asset_factory(pathname, ext) | ||
context.asset_paths.asset_for(pathname, 'js') | ||
end | ||
|
||
def self.asset_path_for(filepath) | ||
context.asset_path(filepath) | ||
end | ||
|
||
def self.context | ||
return @context if @context | ||
@context = ::Rails.application.assets.context_class | ||
@context.extend(::Sprockets::Helpers::IsolatedHelper) | ||
@context.extend(::Sprockets::Helpers::RailsHelper) | ||
end | ||
|
||
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
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
Oops, something went wrong.