teaspoon-qunit 1.18.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teaspoon/qunit/assets/qunit/1.19.0.js +3963 -0
- data/lib/teaspoon/qunit/assets/teaspoon-qunit.js +208 -93
- data/lib/teaspoon/qunit/assets/teaspoon/qunit/spec.coffee +2 -2
- data/lib/teaspoon/qunit/assets/teaspoon/qunit/suite.coffee +2 -9
- data/lib/teaspoon/qunit/framework.rb +1 -1
- data/lib/teaspoon/qunit/templates/test_helper.coffee +1 -1
- data/lib/teaspoon/qunit/templates/test_helper.js +1 -1
- data/lib/teaspoon/qunit/version.rb +1 -1
- data/spec/console_spec.rb +17 -14
- data/spec/installation_spec.rb +8 -5
- data/test/javascripts/qunit/spec_test.coffee +6 -1
- data/test/javascripts/qunit/suite_test.coffee +6 -1
- data/test/teaspoon_env.rb +1 -1
- metadata +4 -3
@@ -1,9 +1,9 @@
|
|
1
|
-
class Teaspoon.Qunit.Spec
|
1
|
+
class Teaspoon.Qunit.Spec extends Teaspoon.Spec
|
2
2
|
|
3
3
|
constructor: (@spec) ->
|
4
4
|
@fullDescription = "#{@spec.module} #{@spec.name}"
|
5
5
|
@description = "#{@spec.name} (#{@spec.failed}, #{@spec.passed}, #{@spec.total})"
|
6
|
-
@link =
|
6
|
+
@link = @filterUrl("#{@spec.module}: #{@spec.name}")
|
7
7
|
@parent = if @spec.module then new Teaspoon.Qunit.Suite({description: @spec.module}) else null
|
8
8
|
@suiteName = @spec.module
|
9
9
|
@viewId = @spec.viewId
|
@@ -1,16 +1,9 @@
|
|
1
|
-
class Teaspoon.Qunit.Suite
|
1
|
+
class Teaspoon.Qunit.Suite extends Teaspoon.Suite
|
2
2
|
|
3
3
|
constructor: (@suite) ->
|
4
4
|
# In QUnit 1.14, moduleStart uses @suite.name,
|
5
5
|
# moduleDone uses @suite.description
|
6
6
|
@fullDescription = @suite.description || @suite.name
|
7
7
|
@description = @suite.description || @suite.name
|
8
|
-
@link =
|
8
|
+
@link = @filterUrl(@fullDescription)
|
9
9
|
@parent = null
|
10
|
-
|
11
|
-
|
12
|
-
# Shim since HTML.SuiteView still initializes the base class.
|
13
|
-
# TODO: inject instance into SuiteView
|
14
|
-
class Teaspoon.Suite
|
15
|
-
constructor: (suite) ->
|
16
|
-
return new Teaspoon.Qunit.Suite(suite)
|
@@ -7,7 +7,7 @@ module Teaspoon
|
|
7
7
|
framework_name :qunit
|
8
8
|
|
9
9
|
# register standard versions
|
10
|
-
versions = ["1.12.0", "1.13.0", "1.14.0", "1.15.0", "1.16.0", "1.17.1", "1.18.0"]
|
10
|
+
versions = ["1.12.0", "1.13.0", "1.14.0", "1.15.0", "1.16.0", "1.17.1", "1.18.0", "1.19.0"]
|
11
11
|
|
12
12
|
versions.each do |version|
|
13
13
|
register_version version, "qunit/#{version}.js",
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
6
6
|
# Use this polyfill to avoid the confusion.
|
7
|
-
#= require support/
|
7
|
+
#= require support/phantomjs-shims
|
8
8
|
#
|
9
9
|
# You can require your own javascript files here. By default this will include everything in application, however you
|
10
10
|
# may get better load performance if you require the specific files that are being used in the test that tests them.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
//
|
5
5
|
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
6
6
|
// Use this polyfill to avoid the confusion.
|
7
|
-
//= require support/
|
7
|
+
//= require support/phantomjs-shims
|
8
8
|
//
|
9
9
|
// You can require your own javascript files here. By default this will include everything in application, however you
|
10
10
|
// may get better load performance if you require the specific files that are being used in the test that tests them.
|
data/spec/console_spec.rb
CHANGED
@@ -2,29 +2,29 @@ require_relative "./spec_helper"
|
|
2
2
|
|
3
3
|
feature "Running in the console", shell: true do
|
4
4
|
let(:expected_loading_output) do
|
5
|
-
<<-OUTPUT.strip_heredoc
|
5
|
+
Regexp.new(<<-OUTPUT.strip_heredoc)
|
6
6
|
Starting the Teaspoon server...
|
7
|
-
Teaspoon running default suite at http://127
|
7
|
+
Teaspoon running default suite at http://127\\.0\\.0\\.1:31337/teaspoon/default
|
8
8
|
OUTPUT
|
9
9
|
end
|
10
10
|
|
11
11
|
let(:expected_testing_output) do
|
12
|
-
<<-OUTPUT.strip_heredoc
|
12
|
+
Regexp.new(<<-OUTPUT.strip_heredoc)
|
13
13
|
FFFit can log to the console
|
14
|
-
|
14
|
+
\\.\\.
|
15
15
|
|
16
16
|
Failures:
|
17
17
|
|
18
|
-
1) global failure (1, 0, 1)
|
19
|
-
Failure/Error: TypeError: undefined is not a constructor (evaluating 'foo()')
|
18
|
+
1\\) global failure \\(1, 0, 1\\)
|
19
|
+
Failure/Error: TypeError: undefined is not a constructor \\(evaluating 'foo\\(\\)'\\)
|
20
20
|
|
21
|
-
2) Integration tests allows failing specs (1, 0, 1)
|
21
|
+
2\\) Integration tests allows failing specs \\(1, 0, 1\\)
|
22
22
|
Failure/Error: fails correctly
|
23
23
|
|
24
|
-
3) Integration tests allows erroring specs (1, 0, 1)
|
24
|
+
3\\) Integration tests allows erroring specs \\(1, 0, 1\\)
|
25
25
|
Failure/Error: errors correctly
|
26
26
|
|
27
|
-
Finished in 0
|
27
|
+
Finished in 0\\.31337 seconds
|
28
28
|
5 examples, 3 failures
|
29
29
|
|
30
30
|
Failed examples:
|
@@ -40,7 +40,10 @@ feature "Running in the console", shell: true do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
before do
|
43
|
-
teaspoon_test_app(
|
43
|
+
teaspoon_test_app(<<-GEMFILE)
|
44
|
+
gem 'teaspoon', path: '#{Teaspoon::DEV_PATH}'
|
45
|
+
gem 'teaspoon-qunit', path: '#{Teaspoon::DEV_PATH}'
|
46
|
+
GEMFILE
|
44
47
|
install_teaspoon("--coffee --version=#{version}")
|
45
48
|
copy_integration_files("test", File.expand_path("../../test", __FILE__), "test")
|
46
49
|
end
|
@@ -48,15 +51,15 @@ feature "Running in the console", shell: true do
|
|
48
51
|
it "runs successfully using the CLI" do
|
49
52
|
run_teaspoon("--no-color")
|
50
53
|
|
51
|
-
expect(teaspoon_output).to
|
52
|
-
expect(teaspoon_output).to
|
54
|
+
expect(teaspoon_output).to match(expected_loading_output)
|
55
|
+
expect(teaspoon_output).to match(expected_testing_output)
|
53
56
|
end
|
54
57
|
|
55
58
|
it "runs successfully using the rake task" do
|
56
59
|
rake_teaspoon("COLOR=false")
|
57
60
|
|
58
|
-
expect(teaspoon_output).to
|
59
|
-
expect(teaspoon_output).to
|
61
|
+
expect(teaspoon_output).to match(expected_loading_output)
|
62
|
+
expect(teaspoon_output).to match(expected_testing_output)
|
60
63
|
end
|
61
64
|
|
62
65
|
it "can display coverage information" do
|
data/spec/installation_spec.rb
CHANGED
@@ -2,7 +2,10 @@ require_relative "./spec_helper"
|
|
2
2
|
|
3
3
|
feature "Installation", shell: true do
|
4
4
|
before do
|
5
|
-
teaspoon_test_app(
|
5
|
+
teaspoon_test_app(<<-GEMFILE)
|
6
|
+
gem 'teaspoon', path: '#{Teaspoon::DEV_PATH}'
|
7
|
+
gem 'teaspoon-qunit', path: '#{Teaspoon::DEV_PATH}'
|
8
|
+
GEMFILE
|
6
9
|
end
|
7
10
|
|
8
11
|
it "installs the expected files" do
|
@@ -15,8 +18,8 @@ feature "Installation", shell: true do
|
|
15
18
|
create test/javascripts/test_helper.js
|
16
19
|
OUTPUT
|
17
20
|
|
18
|
-
|
19
|
-
|
21
|
+
expect("test/teaspoon_env.rb").to have_file_content(/suite\.use_framework :qunit, "\d+\.\d+\.\d+"/)
|
22
|
+
expect("test/javascripts/test_helper.js").to have_file_content(Regexp.new("require support/your-support-file"))
|
20
23
|
end
|
21
24
|
|
22
25
|
it "can install coffeescript and the teaspoon_env without comments" do
|
@@ -29,7 +32,7 @@ feature "Installation", shell: true do
|
|
29
32
|
create test/javascripts/test_helper.coffee
|
30
33
|
OUTPUT
|
31
34
|
|
32
|
-
|
33
|
-
|
35
|
+
expect("test/teaspoon_env.rb").to have_file_content(/suite\.use_framework :qunit, "\d+\.\d+\.\d+"/)
|
36
|
+
expect("test/javascripts/test_helper.coffee").to have_file_content(Regexp.new("require support/your-support-file"))
|
34
37
|
end
|
35
38
|
end
|
@@ -16,15 +16,20 @@ module "Teaspoon.Qunit.Spec",
|
|
16
16
|
assertions: @mockAssertions
|
17
17
|
|
18
18
|
test "constructor", 7, ->
|
19
|
+
originalParams = Teaspoon.params
|
20
|
+
Teaspoon.params.file = "spec.js"
|
21
|
+
|
19
22
|
spec = new Teaspoon.Qunit.Spec(@mockSpec)
|
20
23
|
ok(spec.fullDescription == "_full qunit name_ _description_", "sets fullDescription")
|
21
24
|
ok(spec.description == "_description_ (1, 2, 3)", "sets description")
|
22
|
-
ok(spec.link == "?grep=_full%20qunit%20name_%3A%20_description_", "sets link")
|
25
|
+
ok(spec.link == "?grep=_full%20qunit%20name_%3A%20_description_&file=spec.js", "sets link")
|
23
26
|
ok(spec.parent.description == "_full qunit name_", "builds a parent suite")
|
24
27
|
ok(spec.suiteName == "_full qunit name_", "sets suiteName")
|
25
28
|
ok(spec.viewId == 420, "sets viewId")
|
26
29
|
ok(spec.pending == false, "sets pending to false") # no pending support
|
27
30
|
|
31
|
+
Teaspoon.params = originalParams
|
32
|
+
|
28
33
|
test "#errors", 5, ->
|
29
34
|
errors = new Teaspoon.Qunit.Spec(@mockSpec).errors()
|
30
35
|
ok(errors.length == 4, "returns the correct length array")
|
@@ -3,8 +3,13 @@ module "Teaspoon.Qunit.Suite",
|
|
3
3
|
@mockSuite = description: "_full qunit description_"
|
4
4
|
|
5
5
|
test "constructor", 4, ->
|
6
|
+
originalParams = Teaspoon.params
|
7
|
+
Teaspoon.params.file = "spec.js"
|
8
|
+
|
6
9
|
suite = new Teaspoon.Qunit.Suite(@mockSuite)
|
7
10
|
ok(suite.fullDescription == "_full qunit description_", "sets fullDescription")
|
8
11
|
ok(suite.description == "_full qunit description_", "sets description")
|
9
|
-
ok(suite.link == "?grep=_full%20qunit%20description_", "sets link")
|
12
|
+
ok(suite.link == "?grep=_full%20qunit%20description_&file=spec.js", "sets link")
|
10
13
|
ok(suite.parent == null, "sets parent to null") # no structure to consider
|
14
|
+
|
15
|
+
Teaspoon.params = originalParams
|
data/test/teaspoon_env.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teaspoon-qunit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jejacks0n
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: teaspoon
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- lib/teaspoon/qunit/assets/qunit/1.16.0.js
|
42
42
|
- lib/teaspoon/qunit/assets/qunit/1.17.1.js
|
43
43
|
- lib/teaspoon/qunit/assets/qunit/1.18.0.js
|
44
|
+
- lib/teaspoon/qunit/assets/qunit/1.19.0.js
|
44
45
|
- lib/teaspoon/qunit/assets/qunit/MIT.LICENSE
|
45
46
|
- lib/teaspoon/qunit/assets/teaspoon-qunit.js
|
46
47
|
- lib/teaspoon/qunit/assets/teaspoon/qunit.coffee
|
@@ -97,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
99
100
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.4.
|
101
|
+
rubygems_version: 2.4.6
|
101
102
|
signing_key:
|
102
103
|
specification_version: 4
|
103
104
|
summary: 'Teaspoon QUnit: A Javascript test runner built on top of Rails for QUnit'
|