Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Allow "error on console logging" configuration #157

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.0.rc.5

* Adding native extensions build check

## 0.7.2

* Improved finding of CoffeeScript spec line locations
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source :rubygems

# Specify your gem's dependencies in jasmine-headless-webkit.gemspec
# Specify your gem's dependencies in jasmine-headless-webkit-firstbanco.gemspec
gemspec

gem 'rspec'
Expand Down
47 changes: 2 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
_I am looking for a new maintainer for this project. Please contact me via GitHub if you're interested._

# Jasmine Headless WebKit runner

Run your specs at sonic boom speed! No pesky reload button or page rendering slowdowns!

http://johnbintz.github.com/jasmine-headless-webkit/ has the most up-to-date information on using
this project. You can see the source of that site on the gh-pages branch.

## For those who want to hack on the project...

The best way to get everything running that you need for development and testing is
to use Guard:

``` bash
bundle install
bundle exec guard
... build Qt runner ...
... compile CoffeeScript to JS ...
... run RSpec and JHW ...
```

## License

* Copyright (c) 2011 John Bintz
* Original Qt WebKit runner Copyright (c) 2010 Sencha Inc.
* 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
_This is a fork of the original project, from which we have cut our own gem to use with jasmine-coverage_

Please see https://github.com/johnbintz/jasmine-headless-webkit for the original.
3 changes: 3 additions & 0 deletions ext/jasmine-webkit-specrunner/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
system %{make clean}
Qt::Qmake.make!('jasmine-headless-webkit', 'specrunner.pro')

# The build above can fail silently. So we check for the existence of the binary.
raise "\n***********************\nGem jasmine-headless-webkit-firstbanco failed to build. Have you got qtmake installed? On linux you need: sudo apt-get install libqtwebkit-dev qt4-dev-tools" unless File.exist?(File.expand_path('../jasmine-webkit-specrunner', __FILE__))

FileUtils.cp File.expand_path('../Makefile.dummy', __FILE__), File.expand_path('../Makefile', __FILE__)
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ $:.push File.expand_path("../lib", __FILE__)
require "jasmine/headless/version"

Gem::Specification.new do |s|
s.name = "jasmine-headless-webkit"
s.version = Jasmine::Headless::VERSION
s.name = "jasmine-headless-webkit-firstbanco"
s.version = '0.9.0.rc.5'
s.platform = Gem::Platform::RUBY
s.authors = ["John Bintz", "Sencha Inc.", "Pivotal Labs"]
s.email = ["[email protected]"]
s.homepage = ""
s.summary = %q{Run Jasmine specs headlessly in a WebKit browser}
s.description = %q{Run Jasmine specs headlessly}
s.description = %q{Run Jasmine specs headlessly. This is a fork gem that makes firstbanco deploys easier. We don't normally do this, but the original gem is defunct.}

s.rubyforge_project = "jasmine-headless-webkit"

Expand All @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency 'jasmine-core'
s.add_runtime_dependency 'jasmine-core', '1.3.1' # Locking to 1.3.1. 2.0.0 is a breaking change we will have to migrate to.
s.add_runtime_dependency 'coffee-script'
s.add_runtime_dependency 'rainbow'
s.add_runtime_dependency 'multi_json', '>= 1.2.0'
Expand Down
25 changes: 15 additions & 10 deletions lib/jasmine/headless/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module Headless
class Task
include Rake::DSL if defined?(Rake::DSL)

attr_accessor :colors, :keep_on_error, :jasmine_config
attr_accessor :colors, :keep_on_error, :jasmine_config, :error_on_console_log

def initialize(name = 'jasmine:headless')
@colors = false
@keep_on_error = false
@error_on_console_log = true
@jasmine_config = nil

yield self if block_given?
Expand All @@ -18,15 +19,19 @@ def initialize(name = 'jasmine:headless')

private
def run_rake_task
case Jasmine::Headless::Runner.run(
:colors => colors,
:remove_html_file => !@keep_on_error,
:jasmine_config => @jasmine_config
)
when 1
raise Jasmine::Headless::TestFailure
when 2
raise Jasmine::Headless::ConsoleLogUsage
result = Jasmine::Headless::Runner.run(
:colors => colors,
:remove_html_file => !@keep_on_error,
:jasmine_config => @jasmine_config
)
case result
when 1
raise Jasmine::Headless::TestFailure
when 2
raise Jasmine::Headless::ConsoleLogUsage if @error_on_console_log
else
p "Unexpected Jasmine::Headless error code #{result}. If 127, check native extensions have been compiled."
raise Jasmine::Headless::TestFailure
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/jasmine/headless/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Jasmine
module Headless
VERSION = "0.9.0.rc.2"
VERSION = "0.9.0.rc.3"
end
end