Compare commits
26 Commits
lets-start
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
f7384d684c | ||
|
1055dc1016 | ||
|
c1e786f3c5 | ||
|
aa1d989a90 | ||
|
30e1ff8e51 | ||
|
9b41a36841 | ||
|
65137186c8 | ||
|
a89682f771 | ||
|
3815a47d07 | ||
|
724541a2cb | ||
|
1c81ea7286 | ||
|
8c6a792960 | ||
|
1aac97ea1f | ||
|
21590a9a19 | ||
|
68683e4b6c | ||
|
181f4e286a | ||
|
d572b0d6fe | ||
|
af20af8524 | ||
|
0064595dea | ||
|
2e2651d11a | ||
|
c96cbd4aac | ||
|
4f11cba073 | ||
|
bad6839760 | ||
|
453f439271 | ||
|
142a0c974b | ||
|
75dce5b66b |
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ _site/
|
|||||||
jhw.*.html
|
jhw.*.html
|
||||||
coverage/
|
coverage/
|
||||||
tmp/
|
tmp/
|
||||||
|
cache dir/
|
||||||
|
1
Gemfile
1
Gemfile
@ -15,7 +15,6 @@ gem 'guard-cucumber'
|
|||||||
require 'rbconfig'
|
require 'rbconfig'
|
||||||
case RbConfig::CONFIG['host_os']
|
case RbConfig::CONFIG['host_os']
|
||||||
when /darwin/
|
when /darwin/
|
||||||
gem 'rb-fsevent'
|
|
||||||
when /linux/
|
when /linux/
|
||||||
gem 'libnotify'
|
gem 'libnotify'
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
_This project is dead. You should use [Karma](http://karma-runner.github.io/) instead. I do._
|
||||||
|
|
||||||
# Jasmine Headless WebKit runner
|
# Jasmine Headless WebKit runner
|
||||||
|
|
||||||
Run your specs at sonic boom speed! No pesky reload button or page rendering slowdowns!
|
Run your specs at sonic boom speed! No pesky reload button or page rendering slowdowns!
|
||||||
|
2
Rakefile
2
Rakefile
@ -14,7 +14,7 @@ require 'jasmine/headless/task'
|
|||||||
|
|
||||||
Jasmine::Headless::Task.new
|
Jasmine::Headless::Task.new
|
||||||
|
|
||||||
PLATFORMS = %w{1.8.7 1.9.2 ree 1.9.3}
|
PLATFORMS = %w{1.9.2 1.9.3}
|
||||||
|
|
||||||
def rvm_bundle(command = '')
|
def rvm_bundle(command = '')
|
||||||
Bundler.with_clean_env do
|
Bundler.with_clean_env do
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
QMAKE_INFO_PLIST = Info.plist
|
QMAKE_INFO_PLIST = Info.plist
|
||||||
QMAKESPEC = macx-g++
|
|
||||||
QT += network webkit
|
QT += network webkit
|
||||||
|
|
||||||
SOURCES = Page.cpp Runner.cpp
|
SOURCES = Page.cpp Runner.cpp
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
#include "Runner.h"
|
#include "Runner.h"
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
|
||||||
|
#include <getopt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
||||||
#error Use Qt 4.7 or later version
|
#error Use Qt 4.7 or later version
|
||||||
#endif
|
#endif
|
||||||
|
11
features/bin/two_files_from_src_files.feature
Normal file
11
features/bin/two_files_from_src_files.feature
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Feature: Two files from source files
|
||||||
|
Scenario: Files are ordered directly
|
||||||
|
Given I have a test suite
|
||||||
|
When I run `bin/jasmine-headless-webkit -j spec/jasmine/two_files_from_src_files/jasmine.yml -l`
|
||||||
|
Then the exit status should be 0
|
||||||
|
And the following files should be loaded in order:
|
||||||
|
| vendor/vendor-file.js |
|
||||||
|
| vendor/vendor.js |
|
||||||
|
| app/app-file.js |
|
||||||
|
| app/app.js |
|
||||||
|
|
10
features/steps/then/bin/following_files_loaded_in_order.rb
Normal file
10
features/steps/then/bin/following_files_loaded_in_order.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
Then /^the following files should be loaded in order:$/ do |table|
|
||||||
|
files = table.raw.flatten
|
||||||
|
|
||||||
|
@output.lines.collect(&:strip).each do |line|
|
||||||
|
files.shift if line[files.first]
|
||||||
|
end
|
||||||
|
|
||||||
|
files.should be_empty
|
||||||
|
end
|
||||||
|
|
@ -20,9 +20,11 @@ Gem::Specification.new do |s|
|
|||||||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
||||||
s.require_paths = ["lib"]
|
s.require_paths = ["lib"]
|
||||||
|
|
||||||
s.add_runtime_dependency 'jasmine-core', '~> 1.1'
|
s.add_runtime_dependency 'jasmine-core'
|
||||||
s.add_runtime_dependency 'coffee-script'
|
s.add_runtime_dependency 'coffee-script'
|
||||||
s.add_runtime_dependency 'rainbow'
|
s.add_runtime_dependency 'rainbow'
|
||||||
s.add_runtime_dependency 'multi_json'
|
s.add_runtime_dependency 'multi_json', '>= 1.2.0'
|
||||||
s.add_runtime_dependency 'sprockets', '~> 2'
|
s.add_runtime_dependency 'sprockets'
|
||||||
|
s.add_runtime_dependency 'sprockets-vendor_gems'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -54,7 +54,11 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def cache_file
|
def cache_file
|
||||||
@cache_file ||= File.expand_path(File.join(self.class.cache_dir, self.class.cache_type, file)) + '.js'
|
@cache_file ||= File.expand_path(relative_cache_file) + '.js'
|
||||||
|
end
|
||||||
|
|
||||||
|
def relative_cache_file
|
||||||
|
File.join(self.class.cache_dir, self.class.cache_type, file.gsub(Dir.pwd + '/', ''))
|
||||||
end
|
end
|
||||||
|
|
||||||
def fresh?
|
def fresh?
|
||||||
|
@ -4,6 +4,7 @@ require 'multi_json'
|
|||||||
require 'set'
|
require 'set'
|
||||||
require 'sprockets'
|
require 'sprockets'
|
||||||
require 'sprockets/engines'
|
require 'sprockets/engines'
|
||||||
|
require 'sprockets-vendor_gems'
|
||||||
|
|
||||||
module Jasmine::Headless
|
module Jasmine::Headless
|
||||||
class FilesList
|
class FilesList
|
||||||
@ -11,33 +12,12 @@ module Jasmine::Headless
|
|||||||
|
|
||||||
class << self
|
class << self
|
||||||
def asset_paths
|
def asset_paths
|
||||||
return @asset_paths if @asset_paths
|
@asset_paths ||= Sprockets.find_gem_vendor_paths(:for => 'javascripts')
|
||||||
|
|
||||||
require 'rubygems'
|
|
||||||
|
|
||||||
raise StandardError.new("A newer version of Rubygems is required to use vendored assets. Please upgrade.") if !Gem::Specification.respond_to?(:each)
|
|
||||||
|
|
||||||
@asset_paths = []
|
|
||||||
|
|
||||||
Gem::Specification.each { |gemspec| @asset_paths += get_paths_from_gemspec(gemspec) }
|
|
||||||
|
|
||||||
@asset_paths
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_paths_from_gemspec(gemspec)
|
|
||||||
%w{vendor lib app}.collect do |dir|
|
|
||||||
path = File.join(gemspec.gem_dir, dir, "assets/javascripts")
|
|
||||||
|
|
||||||
if File.directory?(path) && !@asset_paths.include?(path)
|
|
||||||
path
|
|
||||||
else
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end.compact
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset!
|
def reset!
|
||||||
@asset_paths = nil
|
@asset_paths = nil
|
||||||
|
@registered_engines = {}
|
||||||
|
|
||||||
# register haml-sprockets and handlebars_assets if it's available...
|
# register haml-sprockets and handlebars_assets if it's available...
|
||||||
%w{haml-sprockets handlebars_assets}.each do |library|
|
%w{haml-sprockets handlebars_assets}.each do |library|
|
||||||
@ -56,16 +36,20 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# ...and unregister ones we don't want/need
|
@sprockets_environment = nil
|
||||||
Sprockets.instance_eval do
|
end
|
||||||
EXCLUDED_FORMATS.each do |extension|
|
|
||||||
register_engine ".#{extension}", Jasmine::Headless::NilTemplate
|
|
||||||
end
|
|
||||||
|
|
||||||
register_engine '.coffee', Jasmine::Headless::CoffeeTemplate
|
def registered_engines
|
||||||
register_engine '.js', Jasmine::Headless::JSTemplate
|
@registered_engines ||= {}
|
||||||
register_engine '.css', Jasmine::Headless::CSSTemplate
|
end
|
||||||
register_engine '.jst', Jasmine::Headless::JSTTemplate
|
|
||||||
|
def register_engine(file_extension, template_class)
|
||||||
|
registered_engines[file_extension] = template_class
|
||||||
|
end
|
||||||
|
|
||||||
|
def register_engines!
|
||||||
|
registered_engines.each do |file_extension, template_class|
|
||||||
|
Sprockets.register_engine file_extension, template_class
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -95,11 +79,21 @@ module Jasmine::Headless
|
|||||||
@required_files = UniqueAssetList.new
|
@required_files = UniqueAssetList.new
|
||||||
@potential_files_to_filter = []
|
@potential_files_to_filter = []
|
||||||
|
|
||||||
|
register_engines!
|
||||||
|
|
||||||
load_initial_assets
|
load_initial_assets
|
||||||
|
|
||||||
use_config if config?
|
use_config if config?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def register_engines!
|
||||||
|
begin
|
||||||
|
require spec_helper
|
||||||
|
rescue LoadError
|
||||||
|
end
|
||||||
|
self.class.register_engines!
|
||||||
|
end
|
||||||
|
|
||||||
def load_initial_assets
|
def load_initial_assets
|
||||||
self.class.default_files.each do |file|
|
self.class.default_files.each do |file|
|
||||||
begin
|
begin
|
||||||
@ -137,6 +131,7 @@ module Jasmine::Headless
|
|||||||
@search_paths += asset_paths.collect { |dir| File.expand_path(dir) }
|
@search_paths += asset_paths.collect { |dir| File.expand_path(dir) }
|
||||||
@search_paths += spec_dir.collect { |dir| File.expand_path(dir) }
|
@search_paths += spec_dir.collect { |dir| File.expand_path(dir) }
|
||||||
|
|
||||||
|
@search_paths.uniq!
|
||||||
@search_paths
|
@search_paths
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -147,6 +142,19 @@ module Jasmine::Headless
|
|||||||
search_paths.each { |path| @sprockets_environment.append_path(path) }
|
search_paths.each { |path| @sprockets_environment.append_path(path) }
|
||||||
|
|
||||||
@sprockets_environment.unregister_postprocessor('application/javascript', Sprockets::SafetyColons)
|
@sprockets_environment.unregister_postprocessor('application/javascript', Sprockets::SafetyColons)
|
||||||
|
|
||||||
|
# ...and unregister ones we don't want/need
|
||||||
|
@sprockets_environment.instance_eval do
|
||||||
|
EXCLUDED_FORMATS.each do |extension|
|
||||||
|
register_engine ".#{extension}", Jasmine::Headless::NilTemplate
|
||||||
|
end
|
||||||
|
|
||||||
|
register_engine '.coffee', Jasmine::Headless::CoffeeTemplate
|
||||||
|
register_engine '.js', Jasmine::Headless::JSTemplate
|
||||||
|
register_engine '.css', Jasmine::Headless::CSSTemplate
|
||||||
|
register_engine '.jst', Jasmine::Headless::JSTTemplate
|
||||||
|
end
|
||||||
|
|
||||||
@sprockets_environment
|
@sprockets_environment
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -227,13 +235,13 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def add_files(patterns, type, dirs)
|
def add_files(patterns, type, dirs)
|
||||||
dirs.product(patterns).each do |search|
|
patterns.each do |pattern|
|
||||||
files = expanded_dir(File.join(*search))
|
dirs.collect { |dir| expanded_dir(File.join(dir, pattern)) }.each do |files|
|
||||||
|
files.sort! { |a, b| Kernel.rand(3) - 1 } if type == 'spec_files'
|
||||||
|
|
||||||
files.sort! { |a, b| Kernel.rand(3) - 1 } if type == 'spec_files'
|
files.each do |path|
|
||||||
|
add_path(path, type)
|
||||||
files.each do |path|
|
end
|
||||||
add_path(path, type)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -247,7 +255,8 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def expanded_dir(path)
|
def expanded_dir(path)
|
||||||
Dir[path].find_all { |file|
|
file_list = Dir.glob(path).sort
|
||||||
|
file_list.find_all { |file|
|
||||||
file[extension_filter] && !alert_if_bad_format?(file)
|
file[extension_filter] && !alert_if_bad_format?(file)
|
||||||
}.collect {
|
}.collect {
|
||||||
|file| File.expand_path(file)
|
|file| File.expand_path(file)
|
||||||
@ -271,7 +280,7 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def src_dir
|
def src_dir
|
||||||
@src_dir ||= config_dir_or_pwd('src_dir')
|
@src_dir ||= config_dir_or_pwd('src_dir') + asset_paths
|
||||||
end
|
end
|
||||||
|
|
||||||
def spec_dir
|
def spec_dir
|
||||||
@ -279,7 +288,7 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def asset_paths
|
def asset_paths
|
||||||
@asset_paths ||= config_dir_or_pwd('asset_paths')
|
@asset_paths ||= config_dir('asset_paths')
|
||||||
end
|
end
|
||||||
|
|
||||||
def spec_file_searches
|
def spec_file_searches
|
||||||
@ -287,9 +296,15 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def config_dir_or_pwd(dir)
|
def config_dir_or_pwd(dir)
|
||||||
found_dir = (@options[:config] && @options[:config][dir]) || Dir.pwd
|
if (found = config_dir(dir)).empty?
|
||||||
|
found = [ Dir.pwd ]
|
||||||
|
end
|
||||||
|
|
||||||
[ found_dir ].flatten.collect { |dir| File.expand_path(dir) }
|
found
|
||||||
|
end
|
||||||
|
|
||||||
|
def config_dir(dir)
|
||||||
|
[ @options[:config] && @options[:config][dir] ].flatten.compact.collect { |dir| File.expand_path(dir) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_for_requested_specs(files)
|
def filter_for_requested_specs(files)
|
||||||
@ -301,5 +316,17 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def spec_helper
|
||||||
|
File.join(spec_dir, "helpers", "spec_helper")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
module Jasmine::Headless
|
||||||
|
extend self
|
||||||
|
|
||||||
|
def register_engine(file_extension, template_class)
|
||||||
|
Jasmine::Headless::FilesList.register_engine(file_extension, template_class)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -33,11 +33,11 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def serialize(data)
|
def serialize(data)
|
||||||
MultiJson.encode(data)
|
MultiJson.dump(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def unserialize(data)
|
def unserialize(data)
|
||||||
MultiJson.decode(data)
|
MultiJson.load(data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
module Jasmine
|
module Jasmine
|
||||||
module Headless
|
module Headless
|
||||||
VERSION = "0.8.4"
|
VERSION = "0.9.0.rc.2"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<script type="text/javascript" src="<%= Jasmine::Headless.root.join('vendor/assets/javascripts/prolog.js') %>"></script>
|
<script type="text/javascript" src="<%= Jasmine::Headless.root.join('vendor/assets/javascripts/prolog.js') %>"></script>
|
||||||
<%= files.join("\n") %>
|
<%= files.join("\n") %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
if (window.JHW) { HeadlessReporterResult.specLineNumbers = <%= MultiJson.encode(spec_lines) %>; }
|
if (window.JHW) { HeadlessReporterResult.specLineNumbers = <%= MultiJson.dump(spec_lines) %>; }
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -35,14 +35,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var location = window.location.href;
|
||||||
|
|
||||||
var getLastModified = function(callback) {
|
var getLastModified = function(callback) {
|
||||||
var http = new XMLHttpRequest();
|
var http = new XMLHttpRequest();
|
||||||
var header;
|
var header;
|
||||||
|
|
||||||
http.open('HEAD', window.location.href, false);
|
http.open('HEAD', location, true);
|
||||||
|
|
||||||
http.onreadystatechange = function() {
|
http.onreadystatechange = function() {
|
||||||
callback(http.getResponseHeader('Last-Modified'));
|
if(http.readyState === http.DONE) {
|
||||||
|
callback(http.getResponseHeader('Last-Modified'));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
http.send();
|
http.send();
|
||||||
}
|
}
|
||||||
|
2
spec/jasmine/two_files_from_src_files/app/app.js
Normal file
2
spec/jasmine/two_files_from_src_files/app/app.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
//= require app-file
|
||||||
|
//
|
7
spec/jasmine/two_files_from_src_files/jasmine.yml
Normal file
7
spec/jasmine/two_files_from_src_files/jasmine.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
src_dir: spec/jasmine/two_files_from_src_files/app
|
||||||
|
|
||||||
|
asset_paths:
|
||||||
|
- "spec/jasmine/two_files_from_src_files/vendor"
|
||||||
|
|
||||||
|
src_files: [ 'vendor.js', 'app.js' ]
|
||||||
|
|
0
spec/jasmine/two_files_from_src_files/vendor/vendor-file.js
vendored
Normal file
0
spec/jasmine/two_files_from_src_files/vendor/vendor-file.js
vendored
Normal file
2
spec/jasmine/two_files_from_src_files/vendor/vendor.js
vendored
Normal file
2
spec/jasmine/two_files_from_src_files/vendor/vendor.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
//= require vendor-file
|
||||||
|
//
|
@ -95,5 +95,28 @@ describe Jasmine::Headless::CacheableAction do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#relative_cache_file' do
|
||||||
|
context 'file is an absolute windows file' do
|
||||||
|
let(:current_path) { 'C:/path' }
|
||||||
|
let(:filename) { "file.coffee" }
|
||||||
|
let(:windows_path) { File.join(current_path, filename) }
|
||||||
|
let(:cache_dir) { 'cache dir' }
|
||||||
|
let(:cache_type) { 'cache type' }
|
||||||
|
|
||||||
|
before do
|
||||||
|
cache_object.stubs(:file).returns(windows_path)
|
||||||
|
|
||||||
|
described_class.stubs(:cache_dir).returns(cache_dir)
|
||||||
|
described_class.stubs(:cache_type).returns(cache_type)
|
||||||
|
|
||||||
|
Dir.stubs(:pwd).returns(current_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
subject { cache_object.relative_cache_file }
|
||||||
|
|
||||||
|
it { should == File.join(cache_dir, cache_type, filename) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,50 +5,6 @@ require 'coffee-script'
|
|||||||
describe Jasmine::Headless::FilesList do
|
describe Jasmine::Headless::FilesList do
|
||||||
let(:files_list) { described_class.new }
|
let(:files_list) { described_class.new }
|
||||||
|
|
||||||
describe '.get_paths_from_gemspec' do
|
|
||||||
include FakeFS::SpecHelpers
|
|
||||||
|
|
||||||
let(:gem_dir) { "dir" }
|
|
||||||
let(:gemspec) { stub(:gem_dir => gem_dir) }
|
|
||||||
|
|
||||||
let(:paths) do
|
|
||||||
%w{vendor lib app}.collect do |dir|
|
|
||||||
File.join(gem_dir, dir, 'assets/javascripts')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
before do
|
|
||||||
paths.each { |path| FileUtils.mkdir_p path }
|
|
||||||
|
|
||||||
described_class.instance_variable_set(:@asset_paths, [])
|
|
||||||
end
|
|
||||||
|
|
||||||
subject { described_class.get_paths_from_gemspec(gemspec) }
|
|
||||||
|
|
||||||
it { should =~ paths }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '.asset_paths' do
|
|
||||||
include FakeFS::SpecHelpers
|
|
||||||
|
|
||||||
let(:dir_one) { 'dir_one' }
|
|
||||||
let(:dir_two) { 'dir_two' }
|
|
||||||
|
|
||||||
let(:gem_one) { stub(:gem_dir => dir_one) }
|
|
||||||
let(:gem_two) { stub(:gem_dir => dir_two) }
|
|
||||||
|
|
||||||
before do
|
|
||||||
described_class.instance_variable_set(:@asset_paths, nil)
|
|
||||||
FileUtils.mkdir_p File.join(dir_two, 'vendor/assets/javascripts')
|
|
||||||
|
|
||||||
Gem::Specification.stubs(:_all).returns([gem_one, gem_two])
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should return all matching gems with vendor/assets/javascripts directories' do
|
|
||||||
described_class.asset_paths.should == [ File.join(dir_two, 'vendor/assets/javascripts') ]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#initialize' do
|
describe '#initialize' do
|
||||||
before do
|
before do
|
||||||
described_class.any_instance.stubs(:load_initial_assets)
|
described_class.any_instance.stubs(:load_initial_assets)
|
||||||
@ -218,6 +174,21 @@ describe Jasmine::Headless::FilesList do
|
|||||||
files_list.files.any? { |file| file['.erb'] }.should be_false
|
files_list.files.any? { |file| file['.erb'] }.should be_false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#register_engine!" do
|
||||||
|
|
||||||
|
before(:each) do
|
||||||
|
Jasmine::Headless::FilesList.reset!
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should register code added via configure blocks" do
|
||||||
|
template_class = mock()
|
||||||
|
described_class.register_engine ".foo", template_class
|
||||||
|
Sprockets.expects(:register_engine).with(".foo", template_class)
|
||||||
|
described_class.new
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
6
vendor/assets/javascripts/intense.coffee
vendored
6
vendor/assets/javascripts/intense.coffee
vendored
@ -11,16 +11,16 @@ window.Intense = {
|
|||||||
methods:
|
methods:
|
||||||
foreground: (color) ->
|
foreground: (color) ->
|
||||||
if Intense.useColors
|
if Intense.useColors
|
||||||
"\033[3#{Intense.colors[color]}m#{this}\033[0m"
|
'\x1b' + "[3#{Intense.colors[color]}m#{this}" + '\x1b' + "[0m"
|
||||||
else
|
else
|
||||||
this
|
this
|
||||||
bright: ->
|
bright: ->
|
||||||
if Intense.useColors
|
if Intense.useColors
|
||||||
"\033[1m#{this}\033[0m"
|
'\x1b' + "[1m#{this}" + '\x1b' + "[0m"
|
||||||
else
|
else
|
||||||
this
|
this
|
||||||
useColors: true
|
useColors: true
|
||||||
moveBack: (count = 1) -> "\033[#{count}D"
|
moveBack: (count = 1) -> '\x1b' + "[#{count}D"
|
||||||
}
|
}
|
||||||
|
|
||||||
for method, code of Intense.methods
|
for method, code of Intense.methods
|
||||||
|
Loading…
Reference in New Issue
Block a user