Permalink
Browse files

Merge branch 'master' into dot-not

  • Loading branch information...
2 parents d16e2b7 + 99bcfdc commit 6574dcc72840c7efa0290a14e4f5d00a845d319f @xian xian committed Feb 27, 2010
Showing with 2,587 additions and 1,962 deletions.
  1. +189 −183 README.markdown
  2. +30 −10 Rakefile
  3. +58 −17 contrib/ruby/jasmine_runner.rb
  4. +2 −2 contrib/ruby/jasmine_spec_builder.rb
  5. +21 −0 cruise_config.rb
  6. +1 −1 doc/files.html
  7. +1 −1 doc/index.html
  8. +1 −1 doc/symbols/_global_.html
  9. +1 −1 doc/symbols/jasmine.Block.html
  10. +1 −1 doc/symbols/jasmine.Clock.html
  11. +35 −1 doc/symbols/jasmine.Env.html
  12. +1 −1 doc/symbols/jasmine.JsApiReporter.html
  13. +532 −177 doc/symbols/jasmine.Matchers.html
  14. +1 −1 doc/symbols/jasmine.MultiReporter.html
  15. +1 −1 doc/symbols/jasmine.NestedResults.html
  16. +1 −1 doc/symbols/jasmine.Reporter.html
  17. +1 −1 doc/symbols/jasmine.Runner.html
  18. +1 −1 doc/symbols/jasmine.Spec.html
  19. +1 −1 doc/symbols/jasmine.Spy.html
  20. +1 −1 doc/symbols/jasmine.Suite.html
  21. +53 −35 doc/symbols/jasmine.html
  22. +1 −1 doc/symbols/jasmine.util.html
  23. +26 −28 doc/symbols/src/lib_TrivialReporter.js.html
  24. +196 −188 doc/symbols/src/src_Env.js.html
  25. +23 −22 doc/symbols/src/src_JsApiReporter.js.html
  26. +304 −375 doc/symbols/src/src_Matchers.js.html
  27. +112 −110 doc/symbols/src/src_PrettyPrinter.js.html
  28. +183 −187 doc/symbols/src/src_Spec.js.html
  29. +524 −508 doc/symbols/src/src_base.js.html
  30. +4 −4 doc/symbols/src/src_mock-timeout.js.html
  31. +1 −1 examples/html/{example_suite.html → example_runner.html}
  32. +14 −5 examples/ruby/Rakefile
  33. +13 −4 examples/ruby/spec/jasmine_spec.rb
  34. +24 −0 examples/ruby/spec/saucelabs.yml
  35. +8 −3 geminstaller.yml
  36. +64 −48 lib/{jasmine-0.10.0.js → jasmine-0.10.1.js}
  37. +1 −1 lib/jasmine.css
  38. +13 −4 spec/jasmine_spec.rb
  39. +24 −0 spec/saucelabs.yml
  40. +1 −4 spec/suites/EnvSpec.js
  41. +50 −2 spec/suites/MatchersSpec.js
  42. +0 −6 spec/suites/RunnerSpec.js
  43. +22 −8 spec/suites/SpySpec.js
  44. +17 −0 spec/suites/UtilSpec.js
  45. +20 −3 src/Matchers.js
  46. +8 −11 src/base.js
  47. +1 −1 src/version.json
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -56,10 +56,10 @@ namespace :jasmine do
end
desc 'Builds lib/jasmine from source'
- task :build => :lint do
+ task :build => [:lint, 'gems:geminstaller'] do
puts 'Building Jasmine from source'
require 'json'
-
+
sources = jasmine_sources
version = version_hash
@@ -119,17 +119,37 @@ jasmine.version_= {
end
namespace :test do
- desc "Run continuous integration tests"
- task :ci => 'jasmine:build' do
- require "spec"
- require 'spec/rake/spectask'
- Spec::Rake::SpecTask.new(:lambda_ci) do |t|
- t.spec_opts = ["--color", "--format", "specdoc"]
- t.spec_files = ["spec/jasmine_spec.rb"]
+ desc "Run continuous integration tests using a local Selenium runner"
+ task :ci => :'ci:local'
+ namespace :ci do
+
+ task :local => 'jasmine:build' do
+ require "spec"
+ require 'spec/rake/spectask'
+ Spec::Rake::SpecTask.new(:lambda_ci) do |t|
+ t.spec_opts = ["--color", "--format", "specdoc"]
+ t.spec_files = ["spec/jasmine_spec.rb"]
+ end
+ Rake::Task[:lambda_ci].invoke
+ end
+
+ desc "Run continuous integration tests using Sauce Labs 'Selenium in the Cloud'"
+ task :saucelabs => ['jasmine:copy_saucelabs_config', 'jasmine:build'] do
+ ENV['SAUCELABS'] = 'true'
+ Rake::Task['jasmine:test:ci:local'].invoke
end
- Rake::Task[:lambda_ci].invoke
end
+ end
+ desc 'Copy saucelabs.yml to work directory'
+ task 'copy_saucelabs_config' do
+ FileUtils.cp '../saucelabs.yml', 'spec'
end
+end
+namespace :gems do
+ desc "Run geminstaller."
+ task :geminstaller do
+ `geminstaller --sudo`
+ end
end
@@ -228,46 +228,53 @@ def initialize(selenium_jar_path, spec_files, dir_mappings, options={})
@browser = options[:browser] ? options[:browser].delete(:browser) : 'firefox'
@selenium_pid = nil
@jasmine_server_pid = nil
+ @selenium_host = 'localhost'
+ @jasmine_server_port = Jasmine::find_unused_port
+ @selenium_server_port = Jasmine::find_unused_port
end
def start
- start_servers
- @client = Jasmine::SimpleClient.new("localhost", @selenium_server_port, "*#{@browser}", "http://localhost:#{@jasmine_server_port}/")
+ start_jasmine_server
+ start_selenium_server
+ @client = Jasmine::SimpleClient.new(@selenium_host, @selenium_server_port, "*#{@browser}", "http://localhost:#{@jasmine_server_port}/")
@client.connect
end
def stop
@client.disconnect
- stop_servers
+ stop_selenium_server
+ stop_jasmine_server
end
- def start_servers
- @jasmine_server_port = Jasmine::find_unused_port
- @selenium_server_port = Jasmine::find_unused_port
-
- @selenium_pid = fork do
- Process.setpgrp
- exec "java -jar #{@selenium_jar_path} -port #{@selenium_server_port} > /dev/null 2>&1"
- end
- puts "selenium started. pid is #{@selenium_pid}"
-
+ def start_jasmine_server
@jasmine_server_pid = fork do
Process.setpgrp
Jasmine::SimpleServer.start(@jasmine_server_port, @spec_files, @dir_mappings, @options)
exit! 0
end
puts "jasmine server started. pid is #{@jasmine_server_pid}"
+ Jasmine::wait_for_listener(@jasmine_server_port, "jasmine server")
+ end
+ def start_selenium_server
+ @selenium_pid = fork do
+ Process.setpgrp
+ exec "java -jar #{@selenium_jar_path} -port #{@selenium_server_port} > /dev/null 2>&1"
+ end
+ puts "selenium started. pid is #{@selenium_pid}"
Jasmine::wait_for_listener(@selenium_server_port, "selenium server")
- Jasmine::wait_for_listener(@jasmine_server_port, "jasmine server")
end
- def stop_servers
- puts "shutting down the servers..."
- Jasmine::kill_process_group(@selenium_pid) if @selenium_pid
+ def stop_jasmine_server
+ puts "shutting down Jasmine server..."
Jasmine::kill_process_group(@jasmine_server_pid) if @jasmine_server_pid
end
+ def stop_selenium_server
+ puts "shutting down Selenium server..."
+ Jasmine::kill_process_group(@selenium_pid) if @selenium_pid
+ end
+
def run
begin
start
@@ -284,6 +291,40 @@ def eval_js(script)
end
end
+ class SauceLabsRunner < Runner
+ def initialize(spec_files, dir_mappings, options={})
+ @spec_files = spec_files
+ @dir_mappings = dir_mappings
+ @options = options
+
+ @browser = options[:browser] ? options[:browser].delete(:browser) : 'firefox'
+ @jasmine_server_pid = nil
+ @jasmine_server_port = Jasmine::find_unused_port
+ @saucelabs_config = SeleniumConfig.new(options[:saucelabs_config], options[:saucelabs_config_file], @jasmine_server_port)
+ end
+
+ def start_selenium_server
+ @sauce_tunnel = SauceTunnel.new(@saucelabs_config)
+ end
+
+ def start
+ start_jasmine_server
+ start_selenium_server
+ @client = Jasmine::SimpleClient.new(@saucelabs_config['selenium_server_address'],
+ 4444,
+ @saucelabs_config['selenium_browser_key'],
+ "http://#{@saucelabs_config['application_address']}")
+ @client.connect
+ end
+
+ def stop
+ @client.disconnect
+ @sauce_tunnel.shutdown
+ stop_jasmine_server
+ end
+
+ end
+
def self.files(f)
result = f
result = result.call if result.respond_to?(:call)
@@ -58,7 +58,7 @@ def load_suite_info
sleep 0.1
end
- @suites = eval_js('JSON.stringify(jsApiReporter.suites())')
+ @suites = eval_js("var result = jsApiReporter.suites(); if (window.Prototype && result && result.toJSON) { result.toJSON()} else { JSON.stringify(result) }")
end
def results_for(spec_id)
@@ -69,7 +69,7 @@ def results_for(spec_id)
def load_results
@spec_results = {}
@spec_ids.each_slice(50) do |slice|
- @spec_results.merge!(eval_js("JSON.stringify(jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}))"))
+ @spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}); if (window.Prototype && result && result.toJSON) { result.toJSON()} else { JSON.stringify(result) }"))
end
@spec_results
end
View
@@ -0,0 +1,21 @@
+# Project-specific configuration for CruiseControl.rb
+Project.configure do |project|
+
+ # Send email notifications about broken and fixed builds to email1@your.site, email2@your.site (default: send to nobody)
+ # project.email_notifier.emails = ['email1@your.site', 'email2@your.site']
+
+ # Set email 'from' field to john@doe.com:
+ # project.email_notifier.from = 'john@doe.com'
+
+ # Build the project by invoking rake task 'custom'
+ project.rake_task = 'jasmine:test:ci:saucelabs'
+
+ # Build the project by invoking shell script "build_my_app.sh". Keep in mind that when the script is invoked,
+ # current working directory is <em>[cruise&nbsp;data]</em>/projects/your_project/work, so if you do not keep build_my_app.sh
+ # in version control, it should be '../build_my_app.sh' instead
+ #project.build_command = 'cp ../saucelabs.yml .'
+
+ # Ping Subversion for new revisions every 5 minutes (default: 30 seconds)
+ # project.scheduler.polling_interval = 5.minutes
+
+end
View
@@ -454,7 +454,7 @@ <h1 class="classTitle">File Index</h1>
</div>
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:30 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>
View
@@ -316,7 +316,7 @@ <h1 class="classTitle">Class Index</h1>
</div>
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:30 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>
@@ -912,7 +912,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:29 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:21 GMT-0800 (PST)
</div>
</body>
</html>
@@ -411,7 +411,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:29 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>
@@ -672,7 +672,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:29 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>
@@ -385,6 +385,15 @@ <h1 class="classTitle">
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
+ <div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#matchersClass">matchersClass</a></b>()
+ </div>
+ <div class="description"></div>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="attributes">&nbsp;</td>
+ <td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#nextSpecId">nextSpecId</a></b>()
</div>
<div class="description"></div>
@@ -912,6 +921,31 @@ <h1 class="classTitle">
<hr />
+ <a name="matchersClass"> </a>
+ <div class="fixedFont">
+
+
+ <b>matchersClass</b>()
+
+ </div>
+ <div class="description">
+
+
+
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+ <hr />
+
<a name="nextSpecId"> </a>
<div class="fixedFont">
@@ -1129,7 +1163,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:29 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>
@@ -816,7 +816,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Nov 10 2009 17:31:30 GMT-0500 (EST)
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>
Oops, something went wrong.

0 comments on commit 6574dcc

Please sign in to comment.