teaspoon 0.7.9 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +382 -260
- data/app/assets/javascripts/teaspoon-angular.js +108 -26241
- data/app/assets/javascripts/teaspoon-jasmine.js +103 -2642
- data/app/assets/javascripts/teaspoon-mocha.js +109 -5416
- data/app/assets/javascripts/teaspoon-qunit.js +107 -2255
- data/app/assets/javascripts/teaspoon-teaspoon.js +0 -1
- data/app/assets/javascripts/teaspoon/angular.coffee +3 -1
- data/app/assets/javascripts/teaspoon/base/hook.coffee +21 -0
- data/app/assets/javascripts/teaspoon/base/reporters/html.coffee +26 -14
- data/app/assets/javascripts/teaspoon/base/reporters/html/progress_view.coffee +1 -1
- data/app/assets/javascripts/teaspoon/base/reporters/html/template.coffee +3 -3
- data/app/assets/javascripts/teaspoon/base/teaspoon.coffee +10 -1
- data/app/assets/javascripts/teaspoon/jasmine.coffee +3 -1
- data/app/assets/javascripts/teaspoon/mocha.coffee +3 -1
- data/app/assets/javascripts/teaspoon/mocha/reporters/html.coffee +1 -1
- data/app/assets/javascripts/teaspoon/qunit.coffee +3 -1
- data/app/assets/javascripts/teaspoon/qunit/reporters/html.coffee +1 -1
- data/app/assets/javascripts/teaspoon/teaspoon.coffee +0 -1
- data/app/assets/stylesheets/teaspoon.css +12 -8
- data/app/controllers/teaspoon/suite_controller.rb +32 -0
- data/app/views/teaspoon/suite/_body.html.erb +0 -0
- data/app/views/teaspoon/suite/_boot.html.erb +4 -0
- data/app/views/teaspoon/suite/_boot_require_js.html.erb +19 -0
- data/app/views/teaspoon/{spec/suites.html.erb → suite/index.html.erb} +6 -7
- data/app/views/teaspoon/suite/show.html.erb +19 -0
- data/bin/teaspoon +1 -1
- data/config/routes.rb +14 -4
- data/lib/generators/teaspoon/install/POST_INSTALL +2 -2
- data/lib/generators/teaspoon/install/install_generator.rb +22 -11
- data/lib/generators/teaspoon/install/templates/_body.html.erb +0 -0
- data/lib/generators/teaspoon/install/templates/_boot.html.erb +4 -0
- data/lib/generators/teaspoon/install/templates/jasmine/env.rb +11 -0
- data/lib/generators/teaspoon/install/templates/jasmine/env_comments.rb +182 -0
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee +8 -6
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.js +8 -7
- data/lib/generators/teaspoon/install/templates/mocha/env.rb +11 -0
- data/lib/generators/teaspoon/install/templates/mocha/env_comments.rb +182 -0
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee +13 -13
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.js +13 -13
- data/lib/generators/teaspoon/install/templates/qunit/env.rb +11 -0
- data/lib/generators/teaspoon/install/templates/qunit/env_comments.rb +182 -0
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.coffee +6 -5
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.js +6 -5
- data/lib/tasks/teaspoon.rake +9 -2
- data/lib/teaspoon.rb +4 -6
- data/lib/teaspoon/command_line.rb +116 -134
- data/lib/teaspoon/configuration.rb +144 -66
- data/lib/teaspoon/console.rb +70 -37
- data/lib/teaspoon/coverage.rb +42 -15
- data/lib/teaspoon/deprecated.rb +65 -0
- data/lib/teaspoon/drivers/base.rb +10 -0
- data/lib/teaspoon/drivers/phantomjs/runner.js +9 -11
- data/lib/teaspoon/drivers/phantomjs_driver.rb +21 -21
- data/lib/teaspoon/drivers/selenium_driver.rb +32 -13
- data/lib/teaspoon/engine.rb +32 -12
- data/lib/teaspoon/environment.rb +16 -12
- data/lib/teaspoon/exceptions.rb +41 -5
- data/lib/teaspoon/exporter.rb +52 -0
- data/lib/teaspoon/formatters/base.rb +171 -0
- data/lib/teaspoon/formatters/clean_formatter.rb +2 -4
- data/lib/teaspoon/formatters/documentation_formatter.rb +60 -0
- data/lib/teaspoon/formatters/dot_formatter.rb +12 -90
- data/lib/teaspoon/formatters/json_formatter.rb +36 -0
- data/lib/teaspoon/formatters/junit_formatter.rb +51 -32
- data/lib/teaspoon/formatters/modules/report_module.rb +76 -0
- data/lib/teaspoon/formatters/pride_formatter.rb +23 -27
- data/lib/teaspoon/formatters/snowday_formatter.rb +7 -11
- data/lib/teaspoon/formatters/swayze_or_oprah_formatter.rb +88 -64
- data/lib/teaspoon/formatters/tap_formatter.rb +18 -27
- data/lib/teaspoon/formatters/tap_y_formatter.rb +35 -45
- data/lib/teaspoon/formatters/teamcity_formatter.rb +69 -31
- data/lib/teaspoon/instrumentation.rb +33 -33
- data/lib/teaspoon/result.rb +2 -1
- data/lib/teaspoon/runner.rb +40 -28
- data/lib/teaspoon/server.rb +23 -25
- data/lib/teaspoon/suite.rb +52 -72
- data/lib/teaspoon/utility.rb +3 -14
- data/lib/teaspoon/version.rb +1 -1
- data/spec/dummy/app/assets/javascripts/integration/integration_spec.coffee +3 -0
- data/spec/dummy/app/assets/javascripts/integration/spec_helper.coffee +2 -0
- data/spec/dummy/config/application.rb +3 -0
- data/spec/features/console_reporter_spec.rb +48 -18
- data/spec/features/hooks_spec.rb +23 -41
- data/spec/features/html_reporter_spec.rb +38 -21
- data/spec/features/install_generator_spec.rb +34 -20
- data/spec/features/instrumentation_spec.rb +3 -2
- data/spec/fixtures/coverage.json +243 -0
- data/spec/javascripts/fixtures/_body.html.erb +1 -0
- data/spec/javascripts/jasmine_helper.coffee +1 -1
- data/spec/javascripts/teaspoon/base/fixture_spec.coffee +4 -4
- data/spec/javascripts/teaspoon/base/reporters/html_spec.coffee +9 -10
- data/spec/javascripts/teaspoon/mocha/reporters/html_mspec.coffee +0 -6
- data/spec/javascripts/teaspoon/phantomjs/runner_spec.coffee +5 -6
- data/spec/javascripts/turbolinks_helper.coffee +1 -1
- data/spec/spec_helper.rb +3 -4
- data/spec/teaspoon/command_line_spec.rb +139 -23
- data/spec/teaspoon/configuration_spec.rb +164 -46
- data/spec/teaspoon/console_spec.rb +142 -47
- data/spec/teaspoon/coverage_spec.rb +98 -28
- data/spec/teaspoon/drivers/base_spec.rb +5 -0
- data/spec/teaspoon/drivers/phantomjs_driver_spec.rb +32 -14
- data/spec/teaspoon/drivers/selenium_driver_spec.rb +32 -24
- data/spec/teaspoon/engine_spec.rb +8 -5
- data/spec/teaspoon/environment_spec.rb +56 -33
- data/spec/teaspoon/exceptions_spec.rb +57 -0
- data/spec/teaspoon/exporter_spec.rb +96 -0
- data/spec/teaspoon/formatters/base_spec.rb +259 -0
- data/spec/teaspoon/formatters/clean_formatter_spec.rb +37 -0
- data/spec/teaspoon/formatters/documentation_formatter_spec.rb +127 -0
- data/spec/teaspoon/formatters/dot_formatter_spec.rb +52 -56
- data/spec/teaspoon/formatters/json_formatter_spec.rb +77 -0
- data/spec/teaspoon/formatters/junit_formatter_spec.rb +72 -35
- data/spec/teaspoon/formatters/pride_formatter_spec.rb +37 -0
- data/spec/teaspoon/formatters/snowday_formatter_spec.rb +35 -0
- data/spec/teaspoon/formatters/tap_formatter_spec.rb +29 -81
- data/spec/teaspoon/formatters/tap_y_formatter_spec.rb +31 -141
- data/spec/teaspoon/formatters/teamcity_formatter_spec.rb +99 -42
- data/spec/teaspoon/instrumentation_spec.rb +44 -44
- data/spec/teaspoon/result_spec.rb +37 -0
- data/spec/teaspoon/runner_spec.rb +70 -59
- data/spec/teaspoon/server_spec.rb +34 -52
- data/spec/teaspoon/suite_spec.rb +42 -188
- data/spec/teaspoon_env.rb +39 -28
- data/vendor/assets/javascripts/{angular-scenario-1.0.5.js → angular/1.0.5.js} +0 -0
- data/vendor/assets/javascripts/{angular-scenario-1.0.5.MIT-LICENSE → angular/MIT-LICENSE} +0 -0
- data/vendor/assets/javascripts/{jasmine-1.3.1.js → jasmine/1.3.1.js} +0 -0
- data/vendor/assets/javascripts/jasmine/2.0.0.js +2412 -0
- data/vendor/assets/javascripts/{jasmine-1.3.1.MIT.LICENSE → jasmine/MIT.LICENSE} +0 -0
- data/vendor/assets/javascripts/{mocha-1.10.0.js → mocha/1.10.0.js} +1 -0
- data/vendor/assets/javascripts/mocha/1.17.1.js +5813 -0
- data/vendor/assets/javascripts/{mocha-1.10.1.MIT.LICENSE → mocha/MIT.LICENSE} +0 -0
- data/vendor/assets/javascripts/{qunit-1.12.0.js → qunit/1.12.0.js} +1 -1
- data/vendor/assets/javascripts/qunit/1.14.0.js +2288 -0
- data/vendor/assets/javascripts/{qunit-1.12.0.MIT.LICENSE → qunit/MIT.LICENSE} +0 -0
- data/vendor/assets/javascripts/support/chai.js +827 -385
- data/vendor/assets/javascripts/support/jasmine-jquery-1.7.0.js +720 -0
- data/vendor/assets/javascripts/support/jasmine-jquery-2.0.0.js +812 -0
- data/vendor/assets/javascripts/support/sinon-chai.js +17 -0
- data/vendor/assets/javascripts/support/sinon.js +1138 -643
- metadata +57 -36
- data/app/controllers/teaspoon/spec_controller.rb +0 -38
- data/app/helpers/teaspoon/spec_helper.rb +0 -36
- data/app/views/teaspoon/spec/_require_js.html.erb +0 -21
- data/app/views/teaspoon/spec/_standard.html.erb +0 -4
- data/app/views/teaspoon/spec/runner.html.erb +0 -19
- data/lib/generators/teaspoon/install/templates/env.rb +0 -38
- data/lib/generators/teaspoon/install/templates/jasmine/initializer.rb +0 -64
- data/lib/generators/teaspoon/install/templates/mocha/initializer.rb +0 -64
- data/lib/generators/teaspoon/install/templates/qunit/initializer.rb +0 -64
- data/lib/teaspoon/check_coverage.rb +0 -33
- data/lib/teaspoon/drivers/base_driver.rb +0 -10
- data/lib/teaspoon/exception_handling.rb +0 -18
- data/lib/teaspoon/formatters/base_formatter.rb +0 -63
- data/spec/dummy/config/initializers/teaspoon.rb +0 -41
- data/spec/teaspoon/check_coverage_spec.rb +0 -50
- data/spec/teaspoon/formatters/base_formatter_spec.rb +0 -45
- data/vendor/assets/javascripts/support/chai.MIT.LICENSE +0 -22
- data/vendor/assets/javascripts/support/expect.MIT.LICENSE +0 -22
- data/vendor/assets/javascripts/support/jasmine-jquery.MIT.LICENSE +0 -20
- data/vendor/assets/javascripts/support/jasmine-jquery.js +0 -659
- data/vendor/assets/javascripts/support/sinon-chai.MIT-ISH.LICENSE +0 -13
- data/vendor/assets/javascripts/support/sinon.BSD.LICENSE +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
+============================================================================+
|
|
2
|
-
Congratulations!
|
|
3
|
-
be found at: https://github.com/modeset/teaspoon
|
|
2
|
+
Congratulations! Teaspoon was successfully installed. Documentation and more
|
|
3
|
+
can be found at: https://github.com/modeset/teaspoon
|
|
4
4
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module Teaspoon
|
|
2
2
|
module Generators
|
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
|
4
|
+
|
|
4
5
|
source_root File.expand_path("../", __FILE__)
|
|
5
6
|
|
|
6
7
|
desc "Installs the Teaspoon initializer into your application."
|
|
@@ -13,22 +14,27 @@ module Teaspoon
|
|
|
13
14
|
class_option :coffee, type: :boolean,
|
|
14
15
|
aliases: "-c",
|
|
15
16
|
default: false,
|
|
16
|
-
desc: "Generate a CoffeeScript spec helper
|
|
17
|
+
desc: "Generate a CoffeeScript spec helper instead of Javascript"
|
|
18
|
+
|
|
19
|
+
class_option :no_comments, type: :boolean,
|
|
20
|
+
aliases: "-q",
|
|
21
|
+
default: false,
|
|
22
|
+
desc: "Install the teaspoon_env.rb without comments"
|
|
17
23
|
|
|
18
|
-
class_option :
|
|
19
|
-
aliases: "-
|
|
20
|
-
default:
|
|
21
|
-
desc: "
|
|
24
|
+
class_option :partials, type: :boolean,
|
|
25
|
+
aliases: "-p",
|
|
26
|
+
default: false,
|
|
27
|
+
desc: "Copy the boot and body partials"
|
|
22
28
|
|
|
23
29
|
def validate_framework
|
|
24
30
|
return if frameworks.include?(options[:framework])
|
|
25
|
-
puts "Unknown framework --
|
|
26
|
-
exit
|
|
31
|
+
puts "Unknown framework -- available #{frameworks.join(", ")}"
|
|
32
|
+
exit(1)
|
|
27
33
|
end
|
|
28
34
|
|
|
29
|
-
def
|
|
30
|
-
|
|
31
|
-
copy_file "templates
|
|
35
|
+
def copy_environment
|
|
36
|
+
source = options[:no_comments] ? "env.rb" : "env_comments.rb"
|
|
37
|
+
copy_file "templates/#{framework}/#{source}", "#{framework_type}/teaspoon_env.rb"
|
|
32
38
|
end
|
|
33
39
|
|
|
34
40
|
def create_structure
|
|
@@ -40,6 +46,12 @@ module Teaspoon
|
|
|
40
46
|
copy_file "templates/#{framework}/#{framework_type}_helper.#{helper_ext}", "#{framework_type}/javascripts/#{framework_type}_helper.#{helper_ext}"
|
|
41
47
|
end
|
|
42
48
|
|
|
49
|
+
def copy_partials
|
|
50
|
+
return unless options[:partials]
|
|
51
|
+
copy_file "templates/_boot.html.erb", "/#{framework_type}/javascripts/fixtures/_boot.html.erb"
|
|
52
|
+
copy_file "templates/_body.html.erb", "/#{framework_type}/javascripts/fixtures/_body.html.erb"
|
|
53
|
+
end
|
|
54
|
+
|
|
43
55
|
def display_readme
|
|
44
56
|
readme "POST_INSTALL" if behavior == :invoke
|
|
45
57
|
end
|
|
@@ -61,7 +73,6 @@ module Teaspoon
|
|
|
61
73
|
def framework_type
|
|
62
74
|
(options[:framework] == "qunit") ? "test" : "spec"
|
|
63
75
|
end
|
|
64
|
-
|
|
65
76
|
end
|
|
66
77
|
end
|
|
67
78
|
end
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Set RAILS_ROOT and load the environment if it's not already loaded.
|
|
2
|
+
unless defined?(Rails)
|
|
3
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
Teaspoon.configure do |config|
|
|
8
|
+
config.suite do |suite|
|
|
9
|
+
suite.use_framework :jasmine, "1.3.1"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Set RAILS_ROOT and load the environment if it's not already loaded.
|
|
2
|
+
unless defined?(Rails)
|
|
3
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
Teaspoon.configure do |config|
|
|
8
|
+
|
|
9
|
+
# Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
|
|
10
|
+
# `http://localhost:3000/jasmine` to run your tests.
|
|
11
|
+
#config.mount_at = "/teaspoon"
|
|
12
|
+
|
|
13
|
+
# Specifies the root where Teaspoon will look for files. If you're testing an engine using a dummy application it can
|
|
14
|
+
# be useful to set this to your engines root (e.g. `Teaspoon::Engine.root`).
|
|
15
|
+
# Note: Defaults to `Rails.root` if nil.
|
|
16
|
+
#config.root = nil
|
|
17
|
+
|
|
18
|
+
# Paths that will be appended to the Rails assets paths
|
|
19
|
+
# Note: Relative to `config.root`.
|
|
20
|
+
#config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets"]
|
|
21
|
+
|
|
22
|
+
# Fixtures are rendered through a controller, which allows using HAML, RABL/JBuilder, etc. Files in these paths will
|
|
23
|
+
# be rendered as fixtures.
|
|
24
|
+
#config.fixture_paths = ["spec/javascripts/fixtures"]
|
|
25
|
+
|
|
26
|
+
# SUITES
|
|
27
|
+
#
|
|
28
|
+
# You can modify the default suite configuration and create new suites here. Suites are isolated from one another.
|
|
29
|
+
#
|
|
30
|
+
# When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
|
|
31
|
+
# omit various directives and the ones defined in the default suite will be used.
|
|
32
|
+
#
|
|
33
|
+
# To run a specific suite
|
|
34
|
+
# - in the browser: http://localhost/teaspoon/[suite_name]
|
|
35
|
+
# - with the rake task: rake teaspoon suite=[suite_name]
|
|
36
|
+
# - with the cli: teaspoon --suite=[suite_name]
|
|
37
|
+
config.suite do |suite|
|
|
38
|
+
|
|
39
|
+
# Specify the framework you would like to use. This allows you to select versions, and will do some basic setup for
|
|
40
|
+
# you -- which you can override with the directives below. This should be specified first, as it can override other
|
|
41
|
+
# directives.
|
|
42
|
+
# Note: If no version is specified, the latest is assumed.
|
|
43
|
+
#
|
|
44
|
+
# Available: jasmine[1.3.1, 2.0.0], mocha[1.10.0, 1.17.1] qunit[1.12.0, 1.14.0]
|
|
45
|
+
suite.use_framework :jasmine, "1.3.1"
|
|
46
|
+
|
|
47
|
+
# Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
|
|
48
|
+
# files need to be within an asset path. You can add asset paths using the `config.asset_paths`.
|
|
49
|
+
#suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
|
|
50
|
+
|
|
51
|
+
# This suites spec helper, which can require additional support files. This file is loaded before any of your test
|
|
52
|
+
# files are loaded.
|
|
53
|
+
#suite.helper = "spec_helper"
|
|
54
|
+
|
|
55
|
+
# The core Teaspoon javascripts. It's recommended to include only the base files here, as you can require support
|
|
56
|
+
# libraries from your spec helper.
|
|
57
|
+
# Note: For CoffeeScript files use `"teaspoon/jasmine"` etc.
|
|
58
|
+
#
|
|
59
|
+
# Available: teaspoon-jasmine, teaspoon-mocha, teaspoon-qunit
|
|
60
|
+
#suite.javascripts = ["jasmine/1.3.1", "teaspoon-jasmine"]
|
|
61
|
+
|
|
62
|
+
# You can include your own stylesheets if you want to change how Teaspoon looks.
|
|
63
|
+
# Note: Spec related CSS can and should be loaded using fixtures.
|
|
64
|
+
#suite.stylesheets = ["teaspoon"]
|
|
65
|
+
|
|
66
|
+
# Partial to be rendered in the head tag of the runner. You can use the provided ones or define your own by creating
|
|
67
|
+
# a `_boot.html.erb` in your fixtures path, and adjust the config to `"/boot"` for instance.
|
|
68
|
+
#
|
|
69
|
+
# Available: boot, boot_require_js
|
|
70
|
+
#suite.boot_partial = "boot"
|
|
71
|
+
|
|
72
|
+
# Partial to be rendered in the body tag of the runner. You can define your own to create a custom body structure.
|
|
73
|
+
#suite.body_partial = "body"
|
|
74
|
+
|
|
75
|
+
# Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
|
|
76
|
+
# default excludes assets from vendor, gems and support libraries.<br/><br/>
|
|
77
|
+
#suite.no_coverage = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
|
|
78
|
+
|
|
79
|
+
# Hooks allow you to use `Teaspoon.hook("fixtures")` before, after, or during your spec run. This will make a
|
|
80
|
+
# synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
|
|
81
|
+
#suite.hook :fixtures, proc{ }
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
|
86
|
+
# be run in the default suite -- but can be focused into a more specific suite.
|
|
87
|
+
#config.suite :targeted do |suite|
|
|
88
|
+
# suite.matcher = "test/javascripts/targeted/*_test.{js,js.coffee,coffee}"
|
|
89
|
+
#end
|
|
90
|
+
|
|
91
|
+
# CONSOLE RUNNER SPECIFIC
|
|
92
|
+
#
|
|
93
|
+
# These configuration directives are applicable only when running via the rake task or command line interface. These
|
|
94
|
+
# directives can be overridden using the command line interface arguments or with ENV variables when using the rake
|
|
95
|
+
# task.
|
|
96
|
+
#
|
|
97
|
+
# Command Line Interface:
|
|
98
|
+
# teaspoon --driver=phantomjs --server-port=31337 --fail-fast=true --format=junit --suite=my_suite /spec/file_spec.js
|
|
99
|
+
#
|
|
100
|
+
# Rake:
|
|
101
|
+
# teaspoon DRIVER=phantomjs SERVER_PORT=31337 FAIL_FAST=true FORMATTERS=junit suite=my_suite
|
|
102
|
+
|
|
103
|
+
# Specify which headless driver to use. Supports PhantomJS and Selenium Webdriver.
|
|
104
|
+
#
|
|
105
|
+
# Available: phantomjs, selenium
|
|
106
|
+
# PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
|
|
107
|
+
# Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
|
|
108
|
+
#config.driver = "phantomjs"
|
|
109
|
+
|
|
110
|
+
# Specify additional options for the driver.
|
|
111
|
+
#
|
|
112
|
+
# PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
|
|
113
|
+
# Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
|
|
114
|
+
#config.driver_options = nil
|
|
115
|
+
|
|
116
|
+
# Specify the timeout for the driver. Specs are expected to complete within this time frame or the run will be
|
|
117
|
+
# considered a failure. This is to avoid issues that can arise where tests stall.
|
|
118
|
+
#config.driver_timeout = 180
|
|
119
|
+
|
|
120
|
+
# Specify a server to use with Rack (e.g. thin, mongrel). If nil is provided Rack::Server is used.
|
|
121
|
+
#config.server = nil
|
|
122
|
+
|
|
123
|
+
# Specify a port to run on a specific port, otherwise Teaspoon will use a random available port.
|
|
124
|
+
#config.server_port = nil
|
|
125
|
+
|
|
126
|
+
# Timeout for starting the server in seconds. If your server is slow to start you may have to bump this, or you may
|
|
127
|
+
# want to lower this if you know it shouldn't take long to start.
|
|
128
|
+
#config.server_timeout = 20
|
|
129
|
+
|
|
130
|
+
# Force Teaspoon to fail immediately after a failing suite. Can be useful to make Teaspoon fail early if you have
|
|
131
|
+
# several suites, but in environments like CI this may not be desirable.
|
|
132
|
+
#config.fail_fast = true
|
|
133
|
+
|
|
134
|
+
# Specify the formatters to use when outputting the results.
|
|
135
|
+
# Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
|
|
136
|
+
#
|
|
137
|
+
# Available: dot, documentation, clean, json, junit, pride, snowday, swayze_or_oprah, tap, tap_y, teamcity
|
|
138
|
+
#config.formatters = ["dot"]
|
|
139
|
+
|
|
140
|
+
# Specify if you want color output from the formatters.
|
|
141
|
+
#config.color = true
|
|
142
|
+
|
|
143
|
+
# Teaspoon pipes all console[log/debug/error] to $stdout. This is useful to catch places where you've forgotten to
|
|
144
|
+
# remove them, but in verbose applications this may not be desirable.
|
|
145
|
+
#config.suppress_log = false
|
|
146
|
+
|
|
147
|
+
# COVERAGE REPORTS / THRESHOLD ASSERTIONS
|
|
148
|
+
#
|
|
149
|
+
# Coverage reports requires Istanbul (https://github.com/gotwarlost/istanbul) to add instrumentation to your code and
|
|
150
|
+
# display coverage statistics.
|
|
151
|
+
#
|
|
152
|
+
# Coverage configurations are similar to suites. You can define several, and use different ones under different
|
|
153
|
+
# conditions.
|
|
154
|
+
#
|
|
155
|
+
# To run with a specific coverage configuration
|
|
156
|
+
# - with the rake task: rake teaspoon USE_COVERAGE=[coverage_name]
|
|
157
|
+
# - with the cli: teaspoon --coverage=[coverage_name]
|
|
158
|
+
|
|
159
|
+
# Specify that you always want a coverage configuration to be used.
|
|
160
|
+
#config.use_coverage = nil
|
|
161
|
+
|
|
162
|
+
config.coverage do |coverage|
|
|
163
|
+
|
|
164
|
+
# Which coverage reports Instanbul should generate. Correlates directly to what Istanbul supports.
|
|
165
|
+
#
|
|
166
|
+
# Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
|
|
167
|
+
#coverage.reports = ["text-summary", "html"]
|
|
168
|
+
|
|
169
|
+
# The path that the coverage should be written to - when there's an artifact to write to disk.
|
|
170
|
+
# Note: Relative to `config.root`.
|
|
171
|
+
#coverage.output_dir = "coverage"
|
|
172
|
+
|
|
173
|
+
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
|
|
174
|
+
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
|
|
175
|
+
#coverage.statements = nil
|
|
176
|
+
#coverage.functions = nil
|
|
177
|
+
#coverage.branches = nil
|
|
178
|
+
#coverage.lines = nil
|
|
179
|
+
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# Teaspoon includes some support files, but you can use anything from your own support path too.
|
|
2
|
-
# require support/jasmine-jquery
|
|
2
|
+
# require support/jasmine-jquery-1.7.0
|
|
3
|
+
# require support/jasmine-jquery-2.0.0
|
|
3
4
|
# require support/sinon
|
|
4
5
|
# require support/your-support-file
|
|
5
6
|
#
|
|
6
|
-
# PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
|
7
|
-
# this polyfill to avoid the confusion.
|
|
7
|
+
# PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
|
8
|
+
# Use this polyfill to avoid the confusion.
|
|
8
9
|
#= require support/bind-poly
|
|
9
10
|
#
|
|
10
11
|
# Deferring execution
|
|
11
|
-
# If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
|
12
|
-
# after everything has been loaded. Simple example of a timeout:
|
|
12
|
+
# If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
|
13
|
+
# Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
|
13
14
|
#
|
|
14
15
|
# Teaspoon.defer = true
|
|
15
16
|
# setTimeout(Teaspoon.execute, 1000)
|
|
@@ -25,5 +26,6 @@
|
|
|
25
26
|
#
|
|
26
27
|
# For more information: http://github.com/modeset/teaspoon
|
|
27
28
|
#
|
|
28
|
-
# You can require javascript files here.
|
|
29
|
+
# You can require your own javascript files here. By default this will include everything in application, however you
|
|
30
|
+
# may get better load performance if you require the specific files that are being used in the spec that tests them.
|
|
29
31
|
#= require application
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// Teaspoon includes some support files, but you can use anything from your own support path too.
|
|
2
|
-
// require support/jasmine-jquery
|
|
2
|
+
// require support/jasmine-jquery-1.7.0
|
|
3
|
+
// require support/jasmine-jquery-2.0.0
|
|
3
4
|
// require support/sinon
|
|
4
5
|
// require support/your-support-file
|
|
5
6
|
//
|
|
6
|
-
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
|
7
|
-
// this polyfill to avoid the confusion.
|
|
7
|
+
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
|
8
|
+
// Use this polyfill to avoid the confusion.
|
|
8
9
|
//= require support/bind-poly
|
|
9
10
|
//
|
|
10
11
|
// Deferring execution
|
|
11
|
-
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
|
12
|
-
// after everything has been loaded. Simple example of a timeout:
|
|
12
|
+
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
|
13
|
+
// Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
|
13
14
|
//
|
|
14
15
|
// Teaspoon.defer = true
|
|
15
16
|
// setTimeout(Teaspoon.execute, 1000)
|
|
@@ -25,6 +26,6 @@
|
|
|
25
26
|
//
|
|
26
27
|
// For more information: http://github.com/modeset/teaspoon
|
|
27
28
|
//
|
|
28
|
-
// You can require javascript files here.
|
|
29
|
+
// You can require your own javascript files here. By default this will include everything in application, however you
|
|
30
|
+
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
|
29
31
|
//= require application
|
|
30
|
-
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Set RAILS_ROOT and load the environment if it's not already loaded.
|
|
2
|
+
unless defined?(Rails)
|
|
3
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
Teaspoon.configure do |config|
|
|
8
|
+
config.suite do |suite|
|
|
9
|
+
suite.use_framework :mocha
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Set RAILS_ROOT and load the environment if it's not already loaded.
|
|
2
|
+
unless defined?(Rails)
|
|
3
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
Teaspoon.configure do |config|
|
|
8
|
+
|
|
9
|
+
# Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
|
|
10
|
+
# `http://localhost:3000/jasmine` to run your tests.
|
|
11
|
+
#config.mount_at = "/teaspoon"
|
|
12
|
+
|
|
13
|
+
# Specifies the root where Teaspoon will look for files. If you're testing an engine using a dummy application it can
|
|
14
|
+
# be useful to set this to your engines root (e.g. `Teaspoon::Engine.root`).
|
|
15
|
+
# Note: Defaults to `Rails.root` if nil.
|
|
16
|
+
#config.root = nil
|
|
17
|
+
|
|
18
|
+
# Paths that will be appended to the Rails assets paths
|
|
19
|
+
# Note: Relative to `config.root`.
|
|
20
|
+
#config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets"]
|
|
21
|
+
|
|
22
|
+
# Fixtures are rendered through a controller, which allows using HAML, RABL/JBuilder, etc. Files in these paths will
|
|
23
|
+
# be rendered as fixtures.
|
|
24
|
+
#config.fixture_paths = ["spec/javascripts/fixtures"]
|
|
25
|
+
|
|
26
|
+
# SUITES
|
|
27
|
+
#
|
|
28
|
+
# You can modify the default suite configuration and create new suites here. Suites are isolated from one another.
|
|
29
|
+
#
|
|
30
|
+
# When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
|
|
31
|
+
# omit various directives and the ones defined in the default suite will be used.
|
|
32
|
+
#
|
|
33
|
+
# To run a specific suite
|
|
34
|
+
# - in the browser: http://localhost/teaspoon/[suite_name]
|
|
35
|
+
# - with the rake task: rake teaspoon suite=[suite_name]
|
|
36
|
+
# - with the cli: teaspoon --suite=[suite_name]
|
|
37
|
+
config.suite do |suite|
|
|
38
|
+
|
|
39
|
+
# Specify the framework you would like to use. This allows you to select versions, and will do some basic setup for
|
|
40
|
+
# you -- which you can override with the directives below. This should be specified first, as it can override other
|
|
41
|
+
# directives.
|
|
42
|
+
# Note: If no version is specified, the latest is assumed.
|
|
43
|
+
#
|
|
44
|
+
# Available: jasmine[1.3.1, 2.0.0], mocha[1.10.0, 1.17.1] qunit[1.12.0, 1.14.0]
|
|
45
|
+
suite.use_framework :mocha
|
|
46
|
+
|
|
47
|
+
# Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
|
|
48
|
+
# files need to be within an asset path. You can add asset paths using the `config.asset_paths`.
|
|
49
|
+
#suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
|
|
50
|
+
|
|
51
|
+
# This suites spec helper, which can require additional support files. This file is loaded before any of your test
|
|
52
|
+
# files are loaded.
|
|
53
|
+
#suite.helper = "spec_helper"
|
|
54
|
+
|
|
55
|
+
# The core Teaspoon javascripts. It's recommended to include only the base files here, as you can require support
|
|
56
|
+
# libraries from your spec helper.
|
|
57
|
+
# Note: For CoffeeScript files use `"teaspoon/jasmine"` etc.
|
|
58
|
+
#
|
|
59
|
+
# Available: teaspoon-jasmine, teaspoon-mocha, teaspoon-qunit
|
|
60
|
+
#suite.javascripts = ["mocha/1.17.1", "teaspoon-mocha"]
|
|
61
|
+
|
|
62
|
+
# You can include your own stylesheets if you want to change how Teaspoon looks.
|
|
63
|
+
# Note: Spec related CSS can and should be loaded using fixtures.
|
|
64
|
+
#suite.stylesheets = ["teaspoon"]
|
|
65
|
+
|
|
66
|
+
# Partial to be rendered in the head tag of the runner. You can use the provided ones or define your own by creating
|
|
67
|
+
# a `_boot.html.erb` in your fixtures path, and adjust the config to `"/boot"` for instance.
|
|
68
|
+
#
|
|
69
|
+
# Available: boot, boot_require_js
|
|
70
|
+
#suite.boot_partial = "boot"
|
|
71
|
+
|
|
72
|
+
# Partial to be rendered in the body tag of the runner. You can define your own to create a custom body structure.
|
|
73
|
+
#suite.body_partial = "body"
|
|
74
|
+
|
|
75
|
+
# Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
|
|
76
|
+
# default excludes assets from vendor, gems and support libraries.<br/><br/>
|
|
77
|
+
#suite.no_coverage = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
|
|
78
|
+
|
|
79
|
+
# Hooks allow you to use `Teaspoon.hook("fixtures")` before, after, or during your spec run. This will make a
|
|
80
|
+
# synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
|
|
81
|
+
#suite.hook :fixtures, proc{ }
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
|
86
|
+
# be run in the default suite -- but can be focused into a more specific suite.
|
|
87
|
+
#config.suite :targeted do |suite|
|
|
88
|
+
# suite.matcher = "test/javascripts/targeted/*_test.{js,js.coffee,coffee}"
|
|
89
|
+
#end
|
|
90
|
+
|
|
91
|
+
# CONSOLE RUNNER SPECIFIC
|
|
92
|
+
#
|
|
93
|
+
# These configuration directives are applicable only when running via the rake task or command line interface. These
|
|
94
|
+
# directives can be overridden using the command line interface arguments or with ENV variables when using the rake
|
|
95
|
+
# task.
|
|
96
|
+
#
|
|
97
|
+
# Command Line Interface:
|
|
98
|
+
# teaspoon --driver=phantomjs --server-port=31337 --fail-fast=true --format=junit --suite=my_suite /spec/file_spec.js
|
|
99
|
+
#
|
|
100
|
+
# Rake:
|
|
101
|
+
# teaspoon DRIVER=phantomjs SERVER_PORT=31337 FAIL_FAST=true FORMATTERS=junit suite=my_suite
|
|
102
|
+
|
|
103
|
+
# Specify which headless driver to use. Supports PhantomJS and Selenium Webdriver.
|
|
104
|
+
#
|
|
105
|
+
# Available: phantomjs, selenium
|
|
106
|
+
# PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
|
|
107
|
+
# Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
|
|
108
|
+
#config.driver = "phantomjs"
|
|
109
|
+
|
|
110
|
+
# Specify additional options for the driver.
|
|
111
|
+
#
|
|
112
|
+
# PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
|
|
113
|
+
# Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
|
|
114
|
+
#config.driver_options = nil
|
|
115
|
+
|
|
116
|
+
# Specify the timeout for the driver. Specs are expected to complete within this time frame or the run will be
|
|
117
|
+
# considered a failure. This is to avoid issues that can arise where tests stall.
|
|
118
|
+
#config.driver_timeout = 180
|
|
119
|
+
|
|
120
|
+
# Specify a server to use with Rack (e.g. thin, mongrel). If nil is provided Rack::Server is used.
|
|
121
|
+
#config.server = nil
|
|
122
|
+
|
|
123
|
+
# Specify a port to run on a specific port, otherwise Teaspoon will use a random available port.
|
|
124
|
+
#config.server_port = nil
|
|
125
|
+
|
|
126
|
+
# Timeout for starting the server in seconds. If your server is slow to start you may have to bump this, or you may
|
|
127
|
+
# want to lower this if you know it shouldn't take long to start.
|
|
128
|
+
#config.server_timeout = 20
|
|
129
|
+
|
|
130
|
+
# Force Teaspoon to fail immediately after a failing suite. Can be useful to make Teaspoon fail early if you have
|
|
131
|
+
# several suites, but in environments like CI this may not be desirable.
|
|
132
|
+
#config.fail_fast = true
|
|
133
|
+
|
|
134
|
+
# Specify the formatters to use when outputting the results.
|
|
135
|
+
# Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
|
|
136
|
+
#
|
|
137
|
+
# Available: dot, documentation, clean, json, junit, pride, snowday, swayze_or_oprah, tap, tap_y, teamcity
|
|
138
|
+
#config.formatters = ["dot"]
|
|
139
|
+
|
|
140
|
+
# Specify if you want color output from the formatters.
|
|
141
|
+
#config.color = true
|
|
142
|
+
|
|
143
|
+
# Teaspoon pipes all console[log/debug/error] to $stdout. This is useful to catch places where you've forgotten to
|
|
144
|
+
# remove them, but in verbose applications this may not be desirable.
|
|
145
|
+
#config.suppress_log = false
|
|
146
|
+
|
|
147
|
+
# COVERAGE REPORTS / THRESHOLD ASSERTIONS
|
|
148
|
+
#
|
|
149
|
+
# Coverage reports requires Istanbul (https://github.com/gotwarlost/istanbul) to add instrumentation to your code and
|
|
150
|
+
# display coverage statistics.
|
|
151
|
+
#
|
|
152
|
+
# Coverage configurations are similar to suites. You can define several, and use different ones under different
|
|
153
|
+
# conditions.
|
|
154
|
+
#
|
|
155
|
+
# To run with a specific coverage configuration
|
|
156
|
+
# - with the rake task: rake teaspoon USE_COVERAGE=[coverage_name]
|
|
157
|
+
# - with the cli: teaspoon --coverage=[coverage_name]
|
|
158
|
+
|
|
159
|
+
# Specify that you always want a coverage configuration to be used.
|
|
160
|
+
#config.use_coverage = nil
|
|
161
|
+
|
|
162
|
+
config.coverage do |coverage|
|
|
163
|
+
|
|
164
|
+
# Which coverage reports Instanbul should generate. Correlates directly to what Istanbul supports.
|
|
165
|
+
#
|
|
166
|
+
# Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
|
|
167
|
+
#coverage.reports = ["text-summary", "html"]
|
|
168
|
+
|
|
169
|
+
# The path that the coverage should be written to - when there's an artifact to write to disk.
|
|
170
|
+
# Note: Relative to `config.root`.
|
|
171
|
+
#coverage.output_dir = "coverage"
|
|
172
|
+
|
|
173
|
+
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
|
|
174
|
+
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
|
|
175
|
+
#coverage.statements = nil
|
|
176
|
+
#coverage.functions = nil
|
|
177
|
+
#coverage.branches = nil
|
|
178
|
+
#coverage.lines = nil
|
|
179
|
+
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|