diff --git a/Gemfile.lock b/Gemfile.lock index 58c4fa1..d135a89 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,41 @@ GEM remote: https://rubygems.org/ specs: - childprocess (0.3.9) + childprocess (0.5.3) ffi (~> 1.0, >= 1.0.11) - cmdparse (2.0.5) - ffi (1.9.0) - highline (1.6.20) - jasmine (2.0.0) + cmdparse (2.0.6) + ffi (1.9.3) + highline (1.6.21) + jasmine (2.0.2) jasmine-core (~> 2.0.0) phantomjs rack (>= 1.2.1) rake - jasmine-core (2.0.0) - jasmine_selenium_runner (0.1.1) + jasmine-core (2.0.1) + jasmine_selenium_runner (0.2.0) jasmine (~> 2.0.0.alpha) sauce-connect selenium-webdriver (~> 2.35) json (1.8.1) - mime-types (2.0) - multi_json (1.9.0) - net-http-persistent (2.9) - net-ssh (2.7.0) + mime-types (1.25.1) + multi_json (1.10.1) + net-http-persistent (2.9.4) + net-ssh (2.9.1) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) - parallel (0.9.0) - parallel_tests (0.15.0) + parallel (1.1.2) + parallel_tests (0.16.6) parallel - phantomjs (1.9.7.0) + phantomjs (1.9.7.1) rack (1.5.2) - rake (0.9.2.2) - rest-client (1.6.7) - mime-types (>= 1.16) - rubyzip (1.0.0) - sauce (3.2.0) + rake (10.3.2) + rdoc (4.1.1) + json (~> 1.4) + rest-client (1.6.8) + mime-types (~> 1.16) + rdoc (>= 2.4.2) + rubyzip (1.1.6) + sauce (3.4.9) childprocess (>= 0.1.6) cmdparse (>= 2.0.2) highline (>= 1.5.0) @@ -40,18 +43,19 @@ GEM net-http-persistent net-ssh net-ssh-gateway - parallel_tests (= 0.15.0) + parallel_tests (= 0.16.6) rest-client - sauce_whisk (~> 0.0.8) + sauce_whisk (~> 0.0.11) selenium-webdriver (>= 0.1.2) - sauce-connect (3.2.0) - sauce (~> 3.2) - sauce_whisk (0.0.10) - rest-client - selenium-webdriver (2.37.0) - childprocess (>= 0.2.5) + sauce-connect (3.4.1) + sauce (~> 3.4) + sauce_whisk (0.0.13) + json (~> 1.8.1) + rest-client (~> 1.6.7) + selenium-webdriver (2.42.0) + childprocess (>= 0.5.0) multi_json (~> 1.0) - rubyzip (~> 1.0.0) + rubyzip (~> 1.0) websocket (~> 1.0.4) websocket (1.0.7) diff --git a/Rakefile b/Rakefile index c17fc9c..566b631 100644 --- a/Rakefile +++ b/Rakefile @@ -3,4 +3,13 @@ require 'jasmine' require 'jasmine_selenium_runner' load 'jasmine/tasks/jasmine.rake' +namespace :jasmine do + task :set_env do + ENV['JASMINE_SELENIUM_CONFIG_PATH'] ||= 'spec/support/jasmine_selenium_runner.yml' + ENV['JASMINE_CONFIG_PATH'] ||= 'spec/support/jasmine.yml' + end +end + +task "jasmine:configure" => "jasmine:set_env" + task :default => "jasmine:ci" diff --git a/spec/javascripts/fake-xml-http-request-spec.js b/spec/fake-xml-http-request-spec.js similarity index 100% rename from spec/javascripts/fake-xml-http-request-spec.js rename to spec/fake-xml-http-request-spec.js diff --git a/spec/javascripts/helpers/spec-helper.js b/spec/helpers/spec-helper.js similarity index 100% rename from spec/javascripts/helpers/spec-helper.js rename to spec/helpers/spec-helper.js diff --git a/spec/javascripts/support/jasmine.yml b/spec/javascripts/support/jasmine.yml deleted file mode 100644 index dad31df..0000000 --- a/spec/javascripts/support/jasmine.yml +++ /dev/null @@ -1,82 +0,0 @@ -src_dir: . - -src_files: - - lib/mock-ajax.js - -spec_dir: - - spec - -spec_files: - - javascripts/*-spec.js - -helpers: - - javascripts/helpers/spec-helper.js - -stylesheets: - -# src_files -# -# Return an array of filepaths relative to src_dir to include before jasmine specs. -# Default: [] -# -# EXAMPLE: -# -# src_files: -# - lib/source1.js -# - lib/source2.js -# - dist/**/*.js -# - -# stylesheets -# -# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs. -# Default: [] -# -# EXAMPLE: -# -# stylesheets: -# - css/style.css -# - stylesheets/*.css -# - -# helpers -# -# Return an array of filepaths relative to spec_dir to include before jasmine specs. -# Default: ["helpers/**/*.js"] -# -# EXAMPLE: -# -# helpers: -# - helpers/**/*.js -# - -# spec_files -# -# Return an array of filepaths relative to spec_dir to include. -# Default: ["**/*[sS]pec.js"] -# -# EXAMPLE: -# -# spec_files: -# - **/*[sS]pec.js -# - -# src_dir -# -# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank. -# Default: project root -# -# EXAMPLE: -# -# src_dir: public -# - -# spec_dir -# -# Spec directory path. Your spec_files must be returned relative to this path. -# Default: spec/javascripts -# -# EXAMPLE: -# -# spec_dir: spec/javascripts -# diff --git a/spec/javascripts/mock-ajax-spec.js b/spec/mock-ajax-spec.js similarity index 100% rename from spec/javascripts/mock-ajax-spec.js rename to spec/mock-ajax-spec.js diff --git a/spec/javascripts/mock-ajax-toplevel-spec.js b/spec/mock-ajax-toplevel-spec.js similarity index 100% rename from spec/javascripts/mock-ajax-toplevel-spec.js rename to spec/mock-ajax-toplevel-spec.js diff --git a/spec/support/jasmine.yml b/spec/support/jasmine.yml new file mode 100644 index 0000000..53c4e67 --- /dev/null +++ b/spec/support/jasmine.yml @@ -0,0 +1,18 @@ +src_dir: src + +src_files: + - requireAjax.js + - '[^b]*.js' # skip boot.js so it's at the end + - boot.js + +spec_dir: + - spec + +spec_files: + - '*-spec.js' + +helpers: + - helpers/spec-helper.js + +stylesheets: + diff --git a/spec/support/jasmine_combined.yml b/spec/support/jasmine_combined.yml new file mode 100644 index 0000000..59938f3 --- /dev/null +++ b/spec/support/jasmine_combined.yml @@ -0,0 +1,16 @@ +src_dir: lib + +src_files: + - mock-ajax.js + +spec_dir: + - spec + +spec_files: + - '*-spec.js' + +helpers: + - helpers/spec-helper.js + +stylesheets: + diff --git a/spec/javascripts/support/jasmine_runner.rb b/spec/support/jasmine_runner.rb similarity index 100% rename from spec/javascripts/support/jasmine_runner.rb rename to spec/support/jasmine_runner.rb diff --git a/spec/javascripts/support/jasmine_selenium_runner.yml b/spec/support/jasmine_selenium_runner.yml similarity index 100% rename from spec/javascripts/support/jasmine_selenium_runner.yml rename to spec/support/jasmine_selenium_runner.yml diff --git a/spec/javascripts/webmock-style-spec.js b/spec/webmock-style-spec.js similarity index 100% rename from spec/javascripts/webmock-style-spec.js rename to spec/webmock-style-spec.js diff --git a/spec/javascripts/with-mock-spec.js b/spec/with-mock-spec.js similarity index 100% rename from spec/javascripts/with-mock-spec.js rename to spec/with-mock-spec.js diff --git a/travis-script.sh b/travis-script.sh index 8c942b8..d81ebca 100644 --- a/travis-script.sh +++ b/travis-script.sh @@ -11,4 +11,6 @@ then fi fi -grunt jshint && bundle exec rake jasmine:ci +grunt jshint +bundle exec rake jasmine:ci +JASMINE_CONFIG_PATH=spec/support/jasmine_combined.yml bundle exec rake jasmine:ci