Skip to content

Instantly share code, notes, and snippets.

@siannopollo
Created February 2, 2011 02:18
Show Gist options
  • Save siannopollo/807128 to your computer and use it in GitHub Desktop.
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 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