Created
February 2, 2011 02:18
-
-
Save siannopollo/807128 to your computer and use it in GitHub Desktop.
Out-of-the-box Jasmine doesn't work with remote files (like loading a framework from google). This allows for it.
This file contains hidden or 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 goes in spec/javascripts/support/jasmine_config.rb | |
Jasmine::Config.class_eval do | |
def src_files_with_remote_files | |
remote_files = simple_config['src_files'].select {|f| f =~ /^http:\/\//} | |
remote_files + src_files_without_remote_files | |
end | |
alias_method :src_files_without_remote_files, :src_files | |
alias_method :src_files, :src_files_with_remote_files | |
def js_files_with_remote_files(*args) | |
defaults = js_files_without_remote_files(*args) | |
defaults.each do |file| | |
file.sub!(/^\/http:\/\//, 'http://') | |
end | |
defaults | |
end | |
alias_method :js_files_without_remote_files, :js_files | |
alias_method :js_files, :js_files_with_remote_files | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment