jasmine-headless-webkit-firstbanco 0.9.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +89 -0
- data/Gemfile +30 -0
- data/Guardfile +41 -0
- data/README.md +44 -0
- data/Rakefile +65 -0
- data/bin/jasmine-headless-webkit +11 -0
- data/config/cucumber.yml +2 -0
- data/ext/jasmine-webkit-specrunner/Info.plist +22 -0
- data/ext/jasmine-webkit-specrunner/Makefile.dummy +5 -0
- data/ext/jasmine-webkit-specrunner/Page.cpp +15 -0
- data/ext/jasmine-webkit-specrunner/Page.h +20 -0
- data/ext/jasmine-webkit-specrunner/Runner.cpp +208 -0
- data/ext/jasmine-webkit-specrunner/Runner.h +73 -0
- data/ext/jasmine-webkit-specrunner/common.pri +8 -0
- data/ext/jasmine-webkit-specrunner/extconf.rb +10 -0
- data/ext/jasmine-webkit-specrunner/specrunner.cpp +79 -0
- data/ext/jasmine-webkit-specrunner/specrunner.pro +5 -0
- data/features/bin/failure.feature +7 -0
- data/features/bin/files.feature +7 -0
- data/features/bin/filtered_run/both_runs.feature +18 -0
- data/features/bin/filtered_run/no_full_run.feature +14 -0
- data/features/bin/help.feature +7 -0
- data/features/bin/quiet_messages.feature +8 -0
- data/features/bin/runner_out.feature +8 -0
- data/features/bin/spec_files_with_same_basename.feature +7 -0
- data/features/bin/success.feature +20 -0
- data/features/bin/success_with_js_error.feature +5 -0
- data/features/bin/tries_to_leave_page.feature +7 -0
- data/features/bin/try_to_click_a_button.feature +7 -0
- data/features/bin/two_files_from_src_files.feature +11 -0
- data/features/bin/with_coffeescript_error.feature +7 -0
- data/features/bin/with_console_log.feature +7 -0
- data/features/bin/with_server.feature +7 -0
- data/features/bin/with_window_prompt.feature +7 -0
- data/features/reporters.feature +24 -0
- data/features/runner.feature +34 -0
- data/features/steps/given/i_have_test_suite.rb +2 -0
- data/features/steps/given/no_existing_file.rb +4 -0
- data/features/steps/given/options/i_have_defaults.rb +4 -0
- data/features/steps/given/options/i_have_reporters.rb +10 -0
- data/features/steps/given/options/i_have_runner_options.rb +3 -0
- data/features/steps/then/bin/exit_status_should_be.rb +3 -0
- data/features/steps/then/bin/file_should_contain_runner.rb +4 -0
- data/features/steps/then/bin/following_files_loaded_in_order.rb +10 -0
- data/features/steps/then/bin/i_should_get_help_output.rb +4 -0
- data/features/steps/then/bin/output_should_include.rb +3 -0
- data/features/steps/then/bin/output_should_not_include.rb +4 -0
- data/features/steps/then/reporting/report_does_not_exist.rb +4 -0
- data/features/steps/then/reporting/report_should_exist.rb +3 -0
- data/features/steps/then/reporting/report_should_have.rb +7 -0
- data/features/steps/then/reporting/report_should_have_seed.rb +4 -0
- data/features/steps/then/runner/it_should_have_exit_status.rb +3 -0
- data/features/steps/then/runner/it_should_include_report_file.rb +4 -0
- data/features/steps/then/runner/it_should_not_include_report_file.rb +3 -0
- data/features/steps/then/templates/it_should_use_reporter.rb +6 -0
- data/features/steps/when/i_delete_file.rb +3 -0
- data/features/steps/when/i_get_runner.rb +4 -0
- data/features/steps/when/i_get_template_writer.rb +4 -0
- data/features/steps/when/i_run_executable.rb +4 -0
- data/features/steps/when/i_run_runner.rb +4 -0
- data/features/support/env.rb +7 -0
- data/jasmine-headless-webkit-firstbanco.gemspec +30 -0
- data/lib/autotest/discover.rb +1 -0
- data/lib/autotest/jasmine.rb +7 -0
- data/lib/autotest/jasmine_mixin.rb +111 -0
- data/lib/autotest/jasmine_rspec2.rb +7 -0
- data/lib/jasmine-headless-webkit.rb +3 -0
- data/lib/jasmine/headless.rb +61 -0
- data/lib/jasmine/headless/cacheable_action.rb +85 -0
- data/lib/jasmine/headless/coffee_script_cache.rb +20 -0
- data/lib/jasmine/headless/coffee_template.rb +36 -0
- data/lib/jasmine/headless/command_line.rb +31 -0
- data/lib/jasmine/headless/css_template.rb +19 -0
- data/lib/jasmine/headless/errors.rb +16 -0
- data/lib/jasmine/headless/file_checker.rb +25 -0
- data/lib/jasmine/headless/files_list.rb +332 -0
- data/lib/jasmine/headless/js_template.rb +23 -0
- data/lib/jasmine/headless/jst_template.rb +15 -0
- data/lib/jasmine/headless/nil_template.rb +14 -0
- data/lib/jasmine/headless/options.rb +206 -0
- data/lib/jasmine/headless/railtie.rb +12 -0
- data/lib/jasmine/headless/report.rb +81 -0
- data/lib/jasmine/headless/report_message.rb +12 -0
- data/lib/jasmine/headless/report_message/console.rb +18 -0
- data/lib/jasmine/headless/report_message/error.rb +20 -0
- data/lib/jasmine/headless/report_message/fail.rb +5 -0
- data/lib/jasmine/headless/report_message/pass.rb +5 -0
- data/lib/jasmine/headless/report_message/seed.rb +14 -0
- data/lib/jasmine/headless/report_message/spec.rb +28 -0
- data/lib/jasmine/headless/report_message/total.rb +31 -0
- data/lib/jasmine/headless/runner.rb +264 -0
- data/lib/jasmine/headless/spec_file_analyzer.rb +44 -0
- data/lib/jasmine/headless/task.rb +39 -0
- data/lib/jasmine/headless/template_writer.rb +65 -0
- data/lib/jasmine/headless/unique_asset_list.rb +16 -0
- data/lib/jasmine/headless/version.rb +5 -0
- data/lib/qt/qmake.rb +155 -0
- data/script/gemfile +11 -0
- data/script/hooks/post-commit +4 -0
- data/script/hooks/pre-commit +15 -0
- data/script/initialize-environment +35 -0
- data/script/install-git-hooks +6 -0
- data/skel/template.html.erb +77 -0
- data/spec/files/UTF-8-test.txt +0 -0
- data/spec/integration/randomization_spec.rb +13 -0
- data/spec/integration/specify_runner_file_spec.rb +22 -0
- data/spec/integration/sprockets_spec.rb +23 -0
- data/spec/jasmine/click_button/click_button.js +5 -0
- data/spec/jasmine/click_button/click_button.yml +12 -0
- data/spec/jasmine/click_button/click_button_spec.js +11 -0
- data/spec/jasmine/coffeescript_error/coffeescript_error.yml +10 -0
- data/spec/jasmine/coffeescript_error/spec.coffee +2 -0
- data/spec/jasmine/coffeescript_error/src.coffee +2 -0
- data/spec/jasmine/console_log/console_log.js +1 -0
- data/spec/jasmine/console_log/console_log.yml +10 -0
- data/spec/jasmine/console_log/console_log_spec.js +7 -0
- data/spec/jasmine/failure/failure.js +1 -0
- data/spec/jasmine/failure/failure.yml +9 -0
- data/spec/jasmine/failure/failure_spec.js +6 -0
- data/spec/jasmine/filtered_failure/failure_spec.js +6 -0
- data/spec/jasmine/filtered_failure/filtered_failure.yml +10 -0
- data/spec/jasmine/filtered_failure/src.js +0 -0
- data/spec/jasmine/filtered_failure/success_spec.js +6 -0
- data/spec/jasmine/filtered_success/filtered_success.yml +10 -0
- data/spec/jasmine/filtered_success/src.js +0 -0
- data/spec/jasmine/filtered_success/success_one_spec.js +6 -0
- data/spec/jasmine/filtered_success/success_other_file.js +7 -0
- data/spec/jasmine/filtered_success/success_two_spec.js +6 -0
- data/spec/jasmine/filtered_success_with_console/filtered_success.yml +10 -0
- data/spec/jasmine/filtered_success_with_console/src.js +0 -0
- data/spec/jasmine/filtered_success_with_console/success_one_spec.js +7 -0
- data/spec/jasmine/filtered_success_with_console/success_two_spec.js +6 -0
- data/spec/jasmine/leave_page/leave_page.js +4 -0
- data/spec/jasmine/leave_page/leave_page.yml +9 -0
- data/spec/jasmine/leave_page/leave_page_spec.js +11 -0
- data/spec/jasmine/noisy/file.js.erb +0 -0
- data/spec/jasmine/noisy/noisy.yml +8 -0
- data/spec/jasmine/noisy/other_file.js +2 -0
- data/spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml +11 -0
- data/spec/jasmine/runner_out_in_jasmine_yml/test.js +2 -0
- data/spec/jasmine/runner_out_in_jasmine_yml/test_spec.coffee +4 -0
- data/spec/jasmine/success/success.js +1 -0
- data/spec/jasmine/success/success.yml +9 -0
- data/spec/jasmine/success/success_spec.js +6 -0
- data/spec/jasmine/success_with_error/success_with_error.js +3 -0
- data/spec/jasmine/success_with_error/success_with_error.yml +9 -0
- data/spec/jasmine/success_with_error/success_with_error_spec.js +6 -0
- data/spec/jasmine/two_files_from_src_files/app/app-file.js +0 -0
- data/spec/jasmine/two_files_from_src_files/app/app.js +2 -0
- data/spec/jasmine/two_files_from_src_files/jasmine.yml +7 -0
- data/spec/jasmine/two_files_from_src_files/vendor/vendor-file.js +0 -0
- data/spec/jasmine/two_files_from_src_files/vendor/vendor.js +2 -0
- data/spec/jasmine/two_spec_files_same_basename/jasmine.yml +6 -0
- data/spec/jasmine/two_spec_files_same_basename/spec.coffee +4 -0
- data/spec/jasmine/two_spec_files_same_basename/spec.js +6 -0
- data/spec/jasmine/window_prompt/source.js +2 -0
- data/spec/jasmine/window_prompt/window_prompt.yml +4 -0
- data/spec/jasmine/with_sprockets_includes/assets/application.js.erb +2 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/code.js +6 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/jquery.string.js +0 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/required.js +3 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/subcode/more_code.js +2 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/templates/that.jst.ejs +1 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/templates/this.jst +2 -0
- data/spec/jasmine/with_sprockets_includes/spec/spec_helper.js +1 -0
- data/spec/jasmine/with_sprockets_includes/spec/things/code_spec.js +9 -0
- data/spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml +12 -0
- data/spec/javascripts/console.log_spec.coffee +15 -0
- data/spec/javascripts/headless_reporter_result_spec.coffee +30 -0
- data/spec/javascripts/helpers/spec_helper.coffee +2 -0
- data/spec/javascripts/jasmine-extensions_spec.coffee +80 -0
- data/spec/javascripts/jasmine.HeadlessReporter.ConsoleBase_spec.coffee +35 -0
- data/spec/javascripts/jasmine.HeadlessReporter.Console_spec.coffee +3 -0
- data/spec/javascripts/jasmine.HeadlessReporter.Tap_spec.coffee +19 -0
- data/spec/javascripts/jasmine.HeadlessReporter_spec.coffee +27 -0
- data/spec/javascripts/support/jasmine.yml +9 -0
- data/spec/lib/jasmine/headless/cacheable_action_spec.rb +122 -0
- data/spec/lib/jasmine/headless/coffee_script_cache_spec.rb +21 -0
- data/spec/lib/jasmine/headless/coffee_template_spec.rb +55 -0
- data/spec/lib/jasmine/headless/css_template_spec.rb +25 -0
- data/spec/lib/jasmine/headless/file_checker_spec.rb +41 -0
- data/spec/lib/jasmine/headless/files_list_spec.rb +194 -0
- data/spec/lib/jasmine/headless/js_template_spec.rb +31 -0
- data/spec/lib/jasmine/headless/jst_template_spec.rb +21 -0
- data/spec/lib/jasmine/headless/nil_template_spec.rb +31 -0
- data/spec/lib/jasmine/headless/options_spec.rb +194 -0
- data/spec/lib/jasmine/headless/report_message/seed_spec.rb +18 -0
- data/spec/lib/jasmine/headless/report_message/spec_spec.rb +20 -0
- data/spec/lib/jasmine/headless/report_spec.rb +95 -0
- data/spec/lib/jasmine/headless/runner_spec.rb +247 -0
- data/spec/lib/jasmine/headless/spec_file_analyzer_spec.rb +68 -0
- data/spec/lib/jasmine/headless/task_spec.rb +92 -0
- data/spec/lib/jasmine/headless/template_writer_spec.rb +92 -0
- data/spec/lib/jasmine/headless/unique_asset_list_spec.rb +22 -0
- data/spec/lib/jasmine/headless_spec.rb +38 -0
- data/spec/lib/qt/qmake_spec.rb +142 -0
- data/spec/skel/template.html.erb_spec.rb +8 -0
- data/spec/spec_helper.rb +113 -0
- data/vendor/assets/coffeescripts/headless_reporter_result.coffee +49 -0
- data/vendor/assets/coffeescripts/prolog.coffee +100 -0
- data/vendor/assets/javascripts/beautify-html.js +463 -0
- data/vendor/assets/javascripts/headless_reporter_result.js +79 -0
- data/vendor/assets/javascripts/intense.coffee +28 -0
- data/vendor/assets/javascripts/jasmine-extensions.coffee +97 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.Console.coffee +8 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.ConsoleBase.coffee +92 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.File.coffee +24 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.Tap.coffee +28 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.Verbose.coffee +64 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.coffee +58 -0
- data/vendor/assets/javascripts/jsDump.js +209 -0
- data/vendor/assets/javascripts/prolog.js +108 -0
- metadata +347 -0
data/lib/qt/qmake.rb
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rubygems/version'
|
4
|
+
|
5
|
+
module Qt
|
6
|
+
class NotInstalledError < StandardError; end
|
7
|
+
class Qmake
|
8
|
+
class << self
|
9
|
+
QMAKES = %w{qmake-qt4 qmake}
|
10
|
+
|
11
|
+
def installed?
|
12
|
+
path != nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def make_installed?
|
16
|
+
make_path != nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def command(project_file = nil)
|
20
|
+
spec = (case platform
|
21
|
+
when :linux
|
22
|
+
"linux-g++"
|
23
|
+
when :freebsd
|
24
|
+
"freebsd-g++"
|
25
|
+
when :mac_os_x
|
26
|
+
"macx-g++"
|
27
|
+
end)
|
28
|
+
|
29
|
+
command = "#{path} #{envs} -spec #{spec}"
|
30
|
+
command << " #{project_file}" if project_file
|
31
|
+
command
|
32
|
+
end
|
33
|
+
|
34
|
+
def make!(name, project_file = nil)
|
35
|
+
@name = name
|
36
|
+
|
37
|
+
check_make!
|
38
|
+
check_qmake!
|
39
|
+
|
40
|
+
system command(project_file)
|
41
|
+
|
42
|
+
system %{make}
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# We need integration tests for these!
|
47
|
+
#
|
48
|
+
def path
|
49
|
+
@path ||= best_qmake
|
50
|
+
end
|
51
|
+
|
52
|
+
def make_path
|
53
|
+
get_exe_path('gmake') || get_exe_path('make')
|
54
|
+
end
|
55
|
+
|
56
|
+
def platform
|
57
|
+
case RbConfig::CONFIG['host_os']
|
58
|
+
when /linux/
|
59
|
+
:linux
|
60
|
+
when /freebsd/i
|
61
|
+
:freebsd
|
62
|
+
when /darwin/
|
63
|
+
:mac_os_x
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def qt_version_of(qmake_path)
|
68
|
+
Gem::Version.new(%x{#{qmake_path} -v}.lines.to_a[1][%r{Using Qt version ([^ ]+) },1])
|
69
|
+
end
|
70
|
+
|
71
|
+
def best_qmake
|
72
|
+
if qmake_path = QMAKES.collect do |path|
|
73
|
+
result = nil
|
74
|
+
if qmake_path = get_exe_path(path)
|
75
|
+
if (qt_version = qt_version_of(qmake_path)) >= Gem::Version.create('4.7')
|
76
|
+
result = [ qmake_path, qt_version ]
|
77
|
+
end
|
78
|
+
end
|
79
|
+
result
|
80
|
+
end.compact.sort { |a, b| b.last <=> a.last }.first
|
81
|
+
qmake_path.first
|
82
|
+
else
|
83
|
+
nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
def envs
|
89
|
+
%w{QMAKE_CC QMAKE_CXX}.collect do |env|
|
90
|
+
if ENV[env]
|
91
|
+
"#{env}=#{ENV[env]}"
|
92
|
+
end
|
93
|
+
end.compact.join(" ")
|
94
|
+
end
|
95
|
+
|
96
|
+
def get_exe_path(command)
|
97
|
+
path = %x{which #{command}}.strip
|
98
|
+
path = nil if path == ''
|
99
|
+
path
|
100
|
+
end
|
101
|
+
|
102
|
+
def check_make!
|
103
|
+
if !make_installed?
|
104
|
+
install_method = (
|
105
|
+
case platform
|
106
|
+
when :linux
|
107
|
+
%{sudo apt-get install make or sudo yum install make}
|
108
|
+
when :freebsd
|
109
|
+
%{install /usr/ports/devel/gmake}
|
110
|
+
when :mac_os_x
|
111
|
+
%{Install XCode, and/or sudo port install make}
|
112
|
+
end
|
113
|
+
)
|
114
|
+
|
115
|
+
$stderr.puts <<-MSG
|
116
|
+
make is not installed. You'll need to install it to build #{@name}.
|
117
|
+
#{install_method} should do it for you.
|
118
|
+
MSG
|
119
|
+
raise NotInstalledError
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def check_qmake!
|
124
|
+
if !installed?
|
125
|
+
install_method = (
|
126
|
+
case platform
|
127
|
+
when :linux
|
128
|
+
<<-MSG
|
129
|
+
sudo apt-get install libqt4-dev qt4-qmake on Debian-based systems, or downloading
|
130
|
+
Nokia's prebuilt binary at http://qt.nokia.com/downloads/
|
131
|
+
MSG
|
132
|
+
when :freebsd
|
133
|
+
<<-MSG
|
134
|
+
Install /usr/ports/www/qt4-webkit and /usr/ports/devel/qmake4.
|
135
|
+
MSG
|
136
|
+
MSG
|
137
|
+
when :mac_os_x
|
138
|
+
<<-MSG
|
139
|
+
sudo port install qt4-mac (for the patient) or downloading Nokia's pre-built binary
|
140
|
+
at http://qt.nokia.com/downloads/
|
141
|
+
MSG
|
142
|
+
end
|
143
|
+
).strip
|
144
|
+
|
145
|
+
$stderr.puts <<-MSG
|
146
|
+
qmake is not installed or is not the right version (#{@name} needs Qt 4.7 or above).
|
147
|
+
You'll need to install it to build #{@name}.
|
148
|
+
#{install_method} should do it for you.
|
149
|
+
MSG
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
data/script/gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
OLD_GIT_DIR=$GIT_DIR
|
4
|
+
|
5
|
+
if [ "$(penchant gemfile-env)" != "remote deployment" ]; then
|
6
|
+
unset GIT_DIR
|
7
|
+
penchant gemfile remote --deployment
|
8
|
+
GIT_DIR=$OLD_GIT_DIR
|
9
|
+
git add Gemfile*
|
10
|
+
fi
|
11
|
+
|
12
|
+
bundle exec rake
|
13
|
+
R=$?
|
14
|
+
if [ $R -ne 0 ]; then exit $R; fi
|
15
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if File.file?('Gemfile.erb')
|
4
|
+
pwd = Dir.pwd
|
5
|
+
|
6
|
+
Dir.chdir '..' do
|
7
|
+
File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
|
8
|
+
repo = line[%r{:git => (['"])([^'"]+)\1}, 2]
|
9
|
+
|
10
|
+
puts "Installing #{repo}"
|
11
|
+
system %{git clone #{repo}}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
puts "Bundling for local environment"
|
16
|
+
system %{script/gemfile local}
|
17
|
+
else
|
18
|
+
puts "Bundling..."
|
19
|
+
system %{bundle}
|
20
|
+
end
|
21
|
+
|
22
|
+
puts "Installing git hooks"
|
23
|
+
system %{script/install-git-hooks}
|
24
|
+
|
25
|
+
bundle = File.file?('Gemfile') ? 'bundle exec' : ''
|
26
|
+
|
27
|
+
command = [ bundle, 'rake', '-s', '-T', 'bootstrap' ]
|
28
|
+
|
29
|
+
if !(%x{#{command.join(' ')}}).empty?
|
30
|
+
puts "Trying to run rake bootstrap..."
|
31
|
+
system %{#{bundle} rake bootstrap}
|
32
|
+
end
|
33
|
+
|
34
|
+
puts "Done!"
|
35
|
+
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
|
5
|
+
<title>Jasmine Test Runner - Generated by jasmine-headless-webkit</title>
|
6
|
+
<script type="text/javascript" src="<%= Jasmine::Headless.root.join('vendor/assets/javascripts/prolog.js') %>"></script>
|
7
|
+
<%= files.join("\n") %>
|
8
|
+
<script type="text/javascript">
|
9
|
+
if (window.JHW) { HeadlessReporterResult.specLineNumbers = <%= MultiJson.dump(spec_lines) %>; }
|
10
|
+
</script>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<script type="text/javascript">
|
14
|
+
jasmine.getEnv().console = {
|
15
|
+
log: function(msg) { JHW.print('stdout', msg + "\n"); }
|
16
|
+
}
|
17
|
+
|
18
|
+
window._onload = window.onload;
|
19
|
+
|
20
|
+
window.onload = function() {
|
21
|
+
if (window._onload && (window._onload != window.onload)) {
|
22
|
+
window._onload();
|
23
|
+
}
|
24
|
+
|
25
|
+
if (window.JHW) {
|
26
|
+
<%= jhw_reporters %>
|
27
|
+
} else {
|
28
|
+
types = [ 'HtmlReporter', 'TrivialReporter' ];
|
29
|
+
|
30
|
+
for (var i = 0, j = types.length; i < j; ++i) {
|
31
|
+
var type = jasmine[types[i]]
|
32
|
+
if (type) {
|
33
|
+
jasmine.getEnv().addReporter(new type());
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
var location = window.location.href;
|
39
|
+
|
40
|
+
var getLastModified = function(callback) {
|
41
|
+
var http = new XMLHttpRequest();
|
42
|
+
var header;
|
43
|
+
|
44
|
+
http.open('HEAD', location, true);
|
45
|
+
|
46
|
+
http.onreadystatechange = function() {
|
47
|
+
if(http.readyState === http.DONE) {
|
48
|
+
callback(http.getResponseHeader('Last-Modified'));
|
49
|
+
}
|
50
|
+
};
|
51
|
+
http.send();
|
52
|
+
}
|
53
|
+
|
54
|
+
getLastModified(function(currentLastModified) {
|
55
|
+
var checker;
|
56
|
+
checker = function() {
|
57
|
+
setTimeout(function() {
|
58
|
+
getLastModified(function(newLastModified) {
|
59
|
+
if (currentLastModified != newLastModified) {
|
60
|
+
setTimeout(function() { window.location.reload(); }, 1000);
|
61
|
+
} else {
|
62
|
+
checker();
|
63
|
+
}
|
64
|
+
});
|
65
|
+
}, 3000);
|
66
|
+
};
|
67
|
+
|
68
|
+
checker();
|
69
|
+
});
|
70
|
+
}
|
71
|
+
|
72
|
+
jasmine.getEnv().execute();
|
73
|
+
}
|
74
|
+
</script>
|
75
|
+
</body>
|
76
|
+
</html>
|
77
|
+
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'randomize run order' do
|
4
|
+
let(:seed) { 100 }
|
5
|
+
|
6
|
+
it 'should randomize the run order' do
|
7
|
+
output = %x{bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml --seed #{seed}}
|
8
|
+
$?.exitstatus.should == 0
|
9
|
+
|
10
|
+
output.should include("--seed #{seed}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'specify runner in jasmine.yml' do
|
4
|
+
before do
|
5
|
+
File.unlink "spec/temp_out.html" if File.file?('spec/temp_out.html')
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should randomize the run order' do
|
9
|
+
output = %x{bin/jasmine-headless-webkit -j spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml}
|
10
|
+
$?.exitstatus.should == 2
|
11
|
+
|
12
|
+
output.should include("made it")
|
13
|
+
output.should include("1 test")
|
14
|
+
|
15
|
+
"spec/temp_out.html".should be_a_file
|
16
|
+
end
|
17
|
+
|
18
|
+
after do
|
19
|
+
File.unlink "spec/temp_out.html" if File.file?('spec/temp_out.html')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'sprockets' do
|
4
|
+
it 'should pull in the code via sprockets' do
|
5
|
+
files = %x{bin/jasmine-headless-webkit -l -j spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml}
|
6
|
+
$?.exitstatus.should == 0
|
7
|
+
files.lines.to_a.should contain_in_order_in_file_list(
|
8
|
+
'assets/application.js.erb: unsupported format',
|
9
|
+
'vendor/assets/javascripts/jquery.js',
|
10
|
+
'templates/that.jst.ejs',
|
11
|
+
'templates/this.jst',
|
12
|
+
'things/jquery.string.js',
|
13
|
+
'assets/things/required.js',
|
14
|
+
'assets/things/code.js',
|
15
|
+
'assets/things/subcode/more_code.js',
|
16
|
+
'spec_helper.js',
|
17
|
+
'spec/things/code_spec.js'
|
18
|
+
)
|
19
|
+
|
20
|
+
files.lines.to_a.any? { |line| line['assets/jquery.string.js: unsupported format'] }.should be_false
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
var success = 1;
|