From 7317a0ab78c6811045d2c5b681085f12437bd420 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 11 Apr 2011 07:00:05 -0400 Subject: [PATCH] readme and gemspec and bin --- README.md | 20 ++++++++++++++++++++ bin/jasmine-headless-webkit | 10 +++++----- jasmine-headless-webkit.gemspec | 6 +++--- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d70a663..1fc28d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,25 @@ +## Introduction + +This gem works with projects that have use the [Jasmine gem](https://github.com/pivotal/jasmine-gem) to +create a `jasmine.yml` file that defines what to test in their Jasmine project. The runner loads that +`jasmine.yml` file and executes the +tests in a Qt WebKit widget, displaying the results to the console and setting the exit code to 0 for +success or 1 for failure. + +`console.log` works, too, so you can run your specs side-by-side in a browser if you're so inclined. + +## Usage + +`jasmine-headless-webkit` [path to jasmine.yml, defaults to spec/javascripts/support/jasmine.yml] + +*This gem is currently as rough as it gets.* + +Installation requires Qt 4.7. See [senchalabs/examples](https://github.com/senchalabs/examples) and [my fork +of examples](https://github.com/johnbintz/examples) for more information on the QtWebKit runner. + Copyright (c) 2010 Sencha Inc. Copyright (c) 2011 John Bintz +Jasmine JavaScript library Copyright (c) 2008-2011 Pivotal Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bin/jasmine-headless-webkit b/bin/jasmine-headless-webkit index 7fae522..921b411 100755 --- a/bin/jasmine-headless-webkit +++ b/bin/jasmine-headless-webkit @@ -3,13 +3,13 @@ require 'yaml' require 'fileutils' -data = YAML.load_file('spec/javascripts/support/jasmine.yml') +data = YAML.load_file(ARGV[0] || 'spec/javascripts/support/jasmine.yml') gem_dir = File.expand_path('../..', __FILE__) files = [ - File.join(gem_dir, 'lib/jasmine/lib/jasmine.js'), - File.join(gem_dir, 'lib/jasmine/lib/jasmine-html.js'), - File.join(gem_dir, 'lib/jasmine/lib/jasmine.css') + 'file://' + File.join(gem_dir, 'jasmine/lib/jasmine.js'), + 'file://' + File.join(gem_dir, 'jasmine/lib/jasmine-html.js'), + 'file://' + File.join(gem_dir, 'jasmine/lib/jasmine.css') ] files += [ [ 'src_files', 'src_dir' ], [ 'stylesheets', 'src_dir' ], [ 'helpers', 'spec_dir' ], [ 'spec_files', 'spec_dir' ] ].collect do |searches, root| @@ -52,7 +52,7 @@ window.console = { log: function(data) { debug.log(JSON.stringify(data)); } }; HTML File.open(target = "specrunner.#{$$}.html", 'w') { |fh| fh.print output } -system %{#{File.join(gem_dir, 'ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner'} #{target}} +system %{#{File.join(gem_dir, 'ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner')} #{target}} status = ($? == 0) ? 0 : 1 FileUtils.rm_f target diff --git a/jasmine-headless-webkit.gemspec b/jasmine-headless-webkit.gemspec index 9a021ca..ced024c 100644 --- a/jasmine-headless-webkit.gemspec +++ b/jasmine-headless-webkit.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |s| s.name = "jasmine-headless-webkit" s.version = Jasmine::Headless::Webkit::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["John Bintz", "Sencha Inc."] + s.authors = ["John Bintz", "Sencha Inc.", "Pivotal Labs"] s.email = ["john@coswellproductions.com"] s.homepage = "" s.summary = %q{Run Jasmine specs headlessly in a WebKit browser} @@ -15,10 +15,10 @@ Gem::Specification.new do |s| s.rubyforge_project = "jasmine-headless-webkit" s.extensions = `git ls-files -- ext/**/extconf.rb`.split("\n") - s.files = `git ls-files`.split("\n") + s.files = `git ls-files`.split("\n") + Dir['jasmine/lib/*'] s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency 'jasmine-gem' + s.add_dependency 'jasmine' end