diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa3827..9f4b29e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,7 @@ * File and line number information for failing specs * Try to build the runner if it's missing -* Smarter directions on getting the right version of Qt installed -* Various bugfixes for things +* Kill warnings and streamline includes ## 0.5.0 diff --git a/Rakefile b/Rakefile index 47c0fb7..02ec64b 100644 --- a/Rakefile +++ b/Rakefile @@ -38,3 +38,9 @@ end task :default => [ 'spec:platforms', 'jasmine:headless' ] +desc "Build the runner" +task :build do + Dir.chdir 'ext/jasmine-headless-specrunner' do + system %{ruby extconf.rb} + end +end diff --git a/dev-bin/hooks/pre-commit b/dev-bin/hooks/pre-commit new file mode 100755 index 0000000..75c11e3 --- /dev/null +++ b/dev-bin/hooks/pre-commit @@ -0,0 +1,5 @@ +#!/bin/bash + +bundle exec rake +if [ $? -ne 0 ]; then exit 1; fi + diff --git a/dev-bin/install-hooks b/dev-bin/install-hooks new file mode 100755 index 0000000..5a7809c --- /dev/null +++ b/dev-bin/install-hooks @@ -0,0 +1,6 @@ +#!/bin/bash + +for i in $PWD/dev-bin/hooks/*; do + ln -sf $i .git/hooks/${i##*/} +done + diff --git a/jasmine-headless-webkit.gemspec b/jasmine-headless-webkit.gemspec index dc2cb46..17aeb06 100644 --- a/jasmine-headless-webkit.gemspec +++ b/jasmine-headless-webkit.gemspec @@ -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_dependency 'jasmine', '~>1.1.beta' + s.add_dependency 'jasmine-core', '~>1.1.beta' s.add_dependency 'coffee-script', '>= 2.2' s.add_dependency 'rainbow' s.add_dependency 'multi_json' diff --git a/lib/jasmine/files_list.rb b/lib/jasmine/files_list.rb index 9f0c8d3..b1313f4 100644 --- a/lib/jasmine/files_list.rb +++ b/lib/jasmine/files_list.rb @@ -1,13 +1,4 @@ -begin - require 'jasmine' -rescue NameError => e - if e.message['ActiveSupport::Concern'] - $stderr.puts "[%s] %s (%s)" % [ "jasmine-gem".color(:red), e.message.color(:white), e.class.name.color(:yellow) ] - $stderr.puts "#{'Jasmine'.color(:red)} believes Rails 3 is available. Try using #{'Bundler'.color(:green)} and running via #{'bundle exec'.color(:green)}." - else - raise e - end -end +require 'jasmine-core' module Jasmine class FilesList diff --git a/lib/jasmine/headless/runner.rb b/lib/jasmine/headless/runner.rb index a9d48a0..4be91c9 100644 --- a/lib/jasmine/headless/runner.rb +++ b/lib/jasmine/headless/runner.rb @@ -3,7 +3,6 @@ require 'jasmine/headless/options' require 'fileutils' -require 'jasmine/base' require 'coffee-script' require 'rainbow' diff --git a/lib/jasmine/headless/task.rb b/lib/jasmine/headless/task.rb index a727378..113030e 100644 --- a/lib/jasmine/headless/task.rb +++ b/lib/jasmine/headless/task.rb @@ -42,7 +42,7 @@ module Jasmine private def create_rails_compliant_task - if Rails.version >= "3.1.0" + if Rails.respond_to?(:version) && Rails.version >= "3.1.0" desc 'Force generate static assets without an MD5 hash, all assets end with -test.' task 'assets:precompile:for_testing' => :environment do Rails.application.assets.digest_class = Digest::JasmineTest diff --git a/spec/lib/jasmine/headless/task_spec.rb b/spec/lib/jasmine/headless/task_spec.rb index a6dc643..0f5d791 100644 --- a/spec/lib/jasmine/headless/task_spec.rb +++ b/spec/lib/jasmine/headless/task_spec.rb @@ -21,16 +21,32 @@ describe Jasmine::Headless::Task do end context 'with Rails' do - before do - module Rails - def self.version - return "0" + context 'without version' do + before do + module Rails + def self.version + return "0" + end end end + + it 'should be OK if rails is defined' do + Jasmine::Headless::Task.new('jasmine:headless') + end end - it 'should be OK if rails is defined' do - Jasmine::Headless::Task.new('jasmine:headless') + context 'with version' do + before do + module Rails + def self.version + return "0" + end + end + end + + it 'should be OK if rails is defined' do + Jasmine::Headless::Task.new('jasmine:headless') + end end end end