teaspoon 0.7.9 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,8 +1,10 @@
|
|
1
|
-
#= require angular-scenario-1.0.5
|
2
1
|
#= require teaspoon/base/teaspoon
|
3
2
|
#= require teaspoon/angular/reporters/console
|
4
3
|
#= require teaspoon/angular/reporters/html
|
5
4
|
|
5
|
+
unless angular?.scenario
|
6
|
+
throw new Teaspoon.Error('Angular Scenario not found -- use `suite.use_framework :angular` and adjust or remove the `suite.javascripts` directive.')
|
7
|
+
|
6
8
|
class Teaspoon.Runner extends Teaspoon.Runner
|
7
9
|
|
8
10
|
setup: ->
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Teaspoon.hook = (name, options = {}) ->
|
2
|
+
|
3
|
+
xhr = null
|
4
|
+
|
5
|
+
xhrRequest = (url, options, callback) ->
|
6
|
+
if window.XMLHttpRequest # Mozilla, Safari, ...
|
7
|
+
xhr = new XMLHttpRequest()
|
8
|
+
else if window.ActiveXObject # IE
|
9
|
+
try xhr = new ActiveXObject("Msxml2.XMLHTTP")
|
10
|
+
catch e
|
11
|
+
try xhr = new ActiveXObject("Microsoft.XMLHTTP")
|
12
|
+
catch e
|
13
|
+
throw("Unable to make Ajax Request") unless xhr
|
14
|
+
|
15
|
+
xhr.onreadystatechange = callback
|
16
|
+
xhr.open(options['method'] || "GET", "#{Teaspoon.root}/#{url}", false)
|
17
|
+
xhr.send(options['payload'])
|
18
|
+
|
19
|
+
xhrRequest "#{Teaspoon.suites.active}/#{name}", options, ->
|
20
|
+
return unless xhr.readyState == 4
|
21
|
+
throw("Unable to call hook \"#{url}\".") unless xhr.status == 200
|
@@ -29,8 +29,6 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
|
|
29
29
|
@findEl("suites").innerHTML = @buildSuiteSelect()
|
30
30
|
@findEl("suite-select")?.onchange = @changeSuite
|
31
31
|
|
32
|
-
@findEl("root-link").href = Teaspoon.root
|
33
|
-
|
34
32
|
@el = @findEl("report-all")
|
35
33
|
|
36
34
|
@showConfiguration()
|
@@ -41,15 +39,19 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
|
|
41
39
|
buildLayout: ->
|
42
40
|
el = @createEl("div")
|
43
41
|
el.id = "teaspoon-interface"
|
44
|
-
el.innerHTML = Teaspoon.Reporters.HTML.template
|
42
|
+
el.innerHTML = Teaspoon.Reporters.HTML.template()
|
45
43
|
document.body.appendChild(el)
|
46
44
|
|
47
45
|
|
48
46
|
buildSuiteSelect: ->
|
49
47
|
return "" if Teaspoon.suites.all.length == 1
|
48
|
+
filename = ""
|
49
|
+
filename = "/index.html" if /index\.html$/.test(window.location.pathname)
|
50
50
|
options = []
|
51
51
|
for suite in Teaspoon.suites.all
|
52
|
-
|
52
|
+
path = [Teaspoon.root, suite].join("/")
|
53
|
+
selected = if Teaspoon.suites.active == suite then " selected" else ""
|
54
|
+
options.push("""<option#{selected} value="#{path}#{filename}">#{suite}</option>""")
|
53
55
|
"""<select id="teaspoon-suite-select">#{options.join("")}</select>"""
|
54
56
|
|
55
57
|
|
@@ -135,13 +137,12 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
|
|
135
137
|
|
136
138
|
|
137
139
|
setFilters: ->
|
138
|
-
|
139
|
-
@filters.push("by
|
140
|
-
@filters.push("by match: #{Teaspoon.params["grep"]} <a href='#{link}'>remove</a>") if Teaspoon.params["grep"]
|
140
|
+
@filters.push("by file: #{Teaspoon.params["file"]}") if Teaspoon.params["file"]
|
141
|
+
@filters.push("by match: #{Teaspoon.params["grep"]}") if Teaspoon.params["grep"]
|
141
142
|
|
142
143
|
|
143
144
|
readConfig: ->
|
144
|
-
@config = config if config = @
|
145
|
+
@config = config if config = @store("teaspoon")
|
145
146
|
|
146
147
|
|
147
148
|
toggleConfig: (e) =>
|
@@ -149,16 +150,20 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
|
|
149
150
|
return unless button.tagName.toLowerCase() == "button"
|
150
151
|
name = button.getAttribute("id").replace(/^teaspoon-/, "")
|
151
152
|
@config[name] = !@config[name]
|
152
|
-
@
|
153
|
-
|
153
|
+
@store("teaspoon", @config)
|
154
|
+
Teaspoon.reload()
|
154
155
|
|
155
156
|
|
156
|
-
changeSuite:
|
157
|
-
|
157
|
+
changeSuite: (e) =>
|
158
|
+
options = e.target.options
|
159
|
+
window.location.href = options[options.selectedIndex].value
|
158
160
|
|
159
161
|
|
160
|
-
|
161
|
-
|
162
|
+
store: (name, value) ->
|
163
|
+
if window.localStorage?.setItem?
|
164
|
+
@localstore(name, value)
|
165
|
+
else
|
166
|
+
@cookie(name, value)
|
162
167
|
|
163
168
|
|
164
169
|
cookie: (name, value = undefined) ->
|
@@ -170,3 +175,10 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
|
|
170
175
|
date = new Teaspoon.Date()
|
171
176
|
date.setDate(date.getDate() + 365)
|
172
177
|
document.cookie = "#{name}=#{escape(JSON.stringify(value))}; expires=#{date.toUTCString()}; path=/;"
|
178
|
+
|
179
|
+
|
180
|
+
localstore: (name, value = undefined) ->
|
181
|
+
if value == undefined
|
182
|
+
JSON.parse(unescape(localStorage.getItem(name)))
|
183
|
+
else
|
184
|
+
localStorage.setItem(name, escape(JSON.stringify(value)))
|
@@ -1,7 +1,7 @@
|
|
1
|
-
Teaspoon.Reporters.HTML.template = """
|
1
|
+
Teaspoon.Reporters.HTML.template = -> """
|
2
2
|
<div class="teaspoon-clearfix">
|
3
3
|
<div id="teaspoon-title">
|
4
|
-
<h1><a href="" id="teaspoon-root-link">Teaspoon</a></h1>
|
4
|
+
<h1><a href="#{Teaspoon.root}" id="teaspoon-root-link">Teaspoon</a></h1>
|
5
5
|
<ul>
|
6
6
|
<li>version: <b id="teaspoon-version"></b></li>
|
7
7
|
<li id="teaspoon-env-info"></li>
|
@@ -28,7 +28,7 @@ Teaspoon.Reporters.HTML.template = """
|
|
28
28
|
<hr/>
|
29
29
|
|
30
30
|
<div id="teaspoon-filter">
|
31
|
-
<h1>
|
31
|
+
<h1>Applied Filters [<a href="#{window.location.pathname}" id="teaspoon-filter-clear">remove</a>]</h1>
|
32
32
|
<ul id="teaspoon-filter-list"></ul>
|
33
33
|
</div>
|
34
34
|
|
@@ -1,13 +1,14 @@
|
|
1
1
|
#= require_self
|
2
2
|
#= require teaspoon/base/runner
|
3
3
|
#= require teaspoon/base/fixture
|
4
|
+
#= require teaspoon/base/hook
|
4
5
|
#= require teaspoon/base/reporters/html
|
5
6
|
#= require teaspoon/base/reporters/console
|
6
7
|
|
7
8
|
class @Teaspoon
|
8
9
|
@defer: false
|
9
10
|
@slow: 75
|
10
|
-
@root:
|
11
|
+
@root: window.location.pathname.replace(/\/+(index\.html)?$/, "").replace(/\/[^\/]*$/, "")
|
11
12
|
@started: false
|
12
13
|
@finished: false
|
13
14
|
@Reporters: {}
|
@@ -58,3 +59,11 @@ class @Teaspoon
|
|
58
59
|
messages = Teaspoon.messages
|
59
60
|
Teaspoon.messages = []
|
60
61
|
messages
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
class Teaspoon.Error extends Error
|
66
|
+
|
67
|
+
constructor: (message) ->
|
68
|
+
@name = "TeaspoonError"
|
69
|
+
@message = (message || "")
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#= require jasmine-1.3.1
|
2
1
|
#= require teaspoon/base/teaspoon
|
3
2
|
#= require teaspoon/jasmine/reporters/html
|
4
3
|
|
4
|
+
unless jasmine?
|
5
|
+
throw new Teaspoon.Error('Jasmine not found -- use `suite.use_framework :jasmine` and adjust or remove the `suite.javascripts` directive.')
|
6
|
+
|
5
7
|
class Teaspoon.Runner extends Teaspoon.Runner
|
6
8
|
|
7
9
|
constructor: ->
|
@@ -1,8 +1,10 @@
|
|
1
|
-
#= require mocha-1.10.0
|
2
1
|
#= require teaspoon/base/teaspoon
|
3
2
|
#= require teaspoon/mocha/reporters/console
|
4
3
|
#= require teaspoon/mocha/reporters/html
|
5
4
|
|
5
|
+
unless mocha?
|
6
|
+
throw new Teaspoon.Error('Mocha not found -- use `suite.use_framework :mocha` and adjust or remove the `suite.javascripts` directive.')
|
7
|
+
|
6
8
|
class Teaspoon.Runner extends Teaspoon.Runner
|
7
9
|
|
8
10
|
constructor: ->
|
@@ -1,8 +1,10 @@
|
|
1
|
-
#= require qunit-1.12.0
|
2
1
|
#= require teaspoon/base/teaspoon
|
3
2
|
#= require teaspoon/qunit/reporters/console
|
4
3
|
#= require teaspoon/qunit/reporters/html
|
5
4
|
|
5
|
+
unless QUnit?
|
6
|
+
throw new Teaspoon.Error('QUnit not found -- use `suite.use_framework :qunit` and adjust or remove the `suite.javascripts` directive.')
|
7
|
+
|
6
8
|
class Teaspoon.Runner extends Teaspoon.Runner
|
7
9
|
|
8
10
|
constructor: ->
|
@@ -78,7 +78,7 @@ html[xmlns] #teaspoon-interface .teaspoon-clearfix {
|
|
78
78
|
background-color: #18c2e8;
|
79
79
|
}
|
80
80
|
|
81
|
-
#teaspoon-progress .
|
81
|
+
#teaspoon-progress .teaspoon-logo {
|
82
82
|
width: 86px;
|
83
83
|
height: 86px;
|
84
84
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAMAAABiiJHFAAAAGFBMVEUAAADw7urz8u3y8ezz8u3z8u3z8u308+5JPTlvAAAAB3RSTlMAHt9DlG6+wwFeZgAAAtRJREFUeNrt2etyozAMBWAdHUl5/zfeZXMRjgV2TPNnp2c6HQqer4rAxAly+0p+2RlW9RtswL/BQvgF1kXw86zK38Rsw00n2dhYb0BzAgKA9m5TfI512aJZD2UfWtcxnWfxRCHvwR62HDvDCrb2KqUKo2vZkLV8uQY5iDWs6JhVmYk3RdiODa1dzLrZMr5YpYifNXfsZg14sRQ5cBVzrt1LSDb/1vqkzSW2kTs2G8grbYBLy2ZBg4tsMnywzAZViQ9Zf7DIHVXwiZnTQbP8C71tkJbF8jzLQCt2XCzMOLiAx6yW1dxdFKrnbfyst15WE/ctZa2OL7CuIn3uZvFacEs2Z91oKuQYPmpg2dn2nhA9y2M2quNM9uGiUFUG1VY9SnY77HNTIZ7jUfQoFcn/PjVv+Wo5zevDybpITM4wO7/56Jh1qQLISWzMUj4PdyzLuaCyEn2xWs8xW2LtxUbNcollNgHlfQZLLJI1FGzIWqKZDt2l4IustSwvtTbDlhW93tpcfiTBk9ZCu9hrH1tXW7btrr2V0Idatyv27PZzcsa0Zz1q1p+siggp4scr0OhZxmuwl2xs7PYrTt9x2wQPWsaNzU8+FIEefVLys2LbRmD/XnZfh6BEq7ntzEq9LVcfLHM9DUe5ZEFXbG4JWjb2rO1eCcyq+2hGCc95w5a13R1MPBdXrjmsvhSY7dZ/x7xnNU+Ki9C0uodbU+zuP4XY21T3PcvmmwI/vRRstyvifbi3TcgULCu2Hs0HGwR8tFw+ZpVSslPrpOhY3pvgIhdY6+6azM0FtmxuRGgOnGZNii5UwVUWoc9zlBuUj9iQIugiVfyYVVmPJdsF62ycsFxnbyesLaus2OvNtWSL8Oqqpo7i6tKuTiyp4+8YA2tqsnWUH6KIue/GDZ+gPv/cwTiN6kdPScIxNmkLD1/UiBPSY/2ZjoY5CSQH0M30Zx4V6TO/z8v+K/YPUO9s8Zs6f9sAAAAASUVORK5CYII=");
|
@@ -250,14 +250,21 @@ html[xmlns] #teaspoon-interface .teaspoon-clearfix {
|
|
250
250
|
#teaspoon-filter h1 {
|
251
251
|
float: left;
|
252
252
|
height: 15px;
|
253
|
-
margin: -11px 15px 0
|
254
|
-
padding: 0 4px;
|
253
|
+
margin: -11px 15px 0 10px;
|
254
|
+
padding: 0 4px 5px;
|
255
255
|
background: #f4f3ee;
|
256
256
|
text-align: right;
|
257
257
|
font-size: 17px;
|
258
258
|
font-weight: 200;
|
259
259
|
color: #7b4f49;
|
260
260
|
}
|
261
|
+
#teaspoon-filter h1 a {
|
262
|
+
text-decoration: none;
|
263
|
+
color: #000;
|
264
|
+
}
|
265
|
+
#teaspoon-filter h1 a:hover {
|
266
|
+
text-decoration: underline;
|
267
|
+
}
|
261
268
|
#teaspoon-filter ul {
|
262
269
|
margin: 0;
|
263
270
|
padding: 3px 10px 6px;
|
@@ -399,7 +406,8 @@ body.teaspoon-passed #teaspoon-progress .teaspoon-indicator {
|
|
399
406
|
#teaspoon-suite-list ul {
|
400
407
|
margin: 0 0 20px 0;
|
401
408
|
padding: 0 0 0 20px;
|
402
|
-
|
409
|
+
list-style: none;
|
410
|
+
font-weight: 200;
|
403
411
|
}
|
404
412
|
#teaspoon-suite-list a {
|
405
413
|
text-decoration: none;
|
@@ -414,10 +422,6 @@ body.teaspoon-passed #teaspoon-progress .teaspoon-indicator {
|
|
414
422
|
font-size: 20px;
|
415
423
|
border-bottom: 1px dotted #cfc8c4;
|
416
424
|
}
|
417
|
-
#teaspoon-suite-list h4 {
|
418
|
-
margin: 0;
|
419
|
-
font-weight: 200;
|
420
|
-
}
|
421
425
|
|
422
426
|
/* Responsive
|
423
427
|
*---------------------------------------------------------------------------*/
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Teaspoon::SuiteController < ActionController::Base
|
2
|
+
helper Teaspoon::SuiteHelper rescue nil
|
3
|
+
|
4
|
+
before_filter :prepend_fixture_paths
|
5
|
+
|
6
|
+
layout false
|
7
|
+
|
8
|
+
def index
|
9
|
+
@suites = Teaspoon::Suite.all
|
10
|
+
end
|
11
|
+
|
12
|
+
def show
|
13
|
+
@suite = Teaspoon::Suite.new(params)
|
14
|
+
end
|
15
|
+
|
16
|
+
def hook
|
17
|
+
Teaspoon::Suite.new(params).hooks[params[:hook].to_s].each { |hook| hook.call }
|
18
|
+
render nothing: true
|
19
|
+
end
|
20
|
+
|
21
|
+
def fixtures
|
22
|
+
render "/#{params[:filename]}"
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def prepend_fixture_paths
|
28
|
+
Teaspoon.configuration.fixture_paths.each do |path|
|
29
|
+
prepend_view_path Teaspoon.configuration.root.join(path)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%
|
2
|
+
rails_config = Rails.application.config
|
3
|
+
require_options = {baseUrl: rails_config.assets.prefix}
|
4
|
+
require_options.merge!(rails_config.requirejs.user_config) if rails_config.respond_to?(:requirejs)
|
5
|
+
specs = @suite.spec_assets(false).map{ |s| "#{s.gsub(/\.js.*$/, "")}" }
|
6
|
+
%>
|
7
|
+
|
8
|
+
<%= javascript_include_tag @suite.helper %>
|
9
|
+
<script type="text/javascript">
|
10
|
+
Teaspoon.onWindowLoad(function () {
|
11
|
+
// setup the Teaspoon path prefix to load /assets
|
12
|
+
require.config(<%= require_options.to_json.html_safe %>);
|
13
|
+
|
14
|
+
// require specs by striping off the .js file extension
|
15
|
+
require(<%= specs.to_json.html_safe %>, function() {
|
16
|
+
Teaspoon.execute();
|
17
|
+
});
|
18
|
+
});
|
19
|
+
</script>
|
@@ -3,9 +3,8 @@
|
|
3
3
|
<head>
|
4
4
|
<title>Teaspoon :: Suites</title>
|
5
5
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
6
|
-
<%=
|
7
|
-
<%=
|
8
|
-
<%= javascript_include_tag_for_teaspoon "teaspoon-teaspoon" %>
|
6
|
+
<%= stylesheet_link_tag "teaspoon" %>
|
7
|
+
<%= javascript_include_tag "teaspoon-teaspoon" %>
|
9
8
|
</head>
|
10
9
|
<body>
|
11
10
|
<div id="teaspoon-interface">
|
@@ -17,19 +16,19 @@
|
|
17
16
|
<li><a href="http://github.com/modeset/teaspoon" target="blank">http://github.com/modeset/teaspoon</a></li>
|
18
17
|
</ul>
|
19
18
|
</div>
|
20
|
-
<div id="teaspoon-progress"><div class="teaspoon-indicator
|
19
|
+
<div id="teaspoon-progress"><div class="teaspoon-indicator teaspoon-logo"></div></div>
|
21
20
|
</div>
|
22
21
|
<div id="teaspoon-controls" class="teaspoon-clearfix">
|
23
|
-
<input type="text" id="teaspoon-filter-input" placeholder="filter
|
22
|
+
<input type="text" id="teaspoon-filter-input" placeholder="filter list" autofocus/>
|
24
23
|
</div>
|
25
24
|
<hr/>
|
26
25
|
<ul id="teaspoon-suite-list">
|
27
26
|
<% for suite in @suites %>
|
28
27
|
<li class="suite">
|
29
|
-
<h1><%= link_to suite.name, suite.
|
28
|
+
<h1><%= link_to suite.name, teaspoon.suite_path(suite.name) %></h1>
|
30
29
|
<ul class="file">
|
31
30
|
<% for file in suite.spec_files %>
|
32
|
-
<
|
31
|
+
<li><%= link_to file[:name], teaspoon.suite_path(suite.name, file: file[:path]) %></li>
|
33
32
|
<% end %>
|
34
33
|
</ul>
|
35
34
|
</li>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Teaspoon :: Javascript Test Runner</title>
|
5
|
+
<meta name="viewport" content="width=device-width, user-scalable=no">
|
6
|
+
<%= csrf_meta_tags %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag *@suite.stylesheets %>
|
9
|
+
<%= javascript_include_tag *@suite.javascripts %>
|
10
|
+
<script type="text/javascript">
|
11
|
+
Teaspoon.version = <%= Teaspoon::VERSION.to_json.html_safe %>;
|
12
|
+
Teaspoon.suites = <%= {all: Teaspoon.configuration.suite_configs.keys, active: @suite.name}.to_json.html_safe %>;
|
13
|
+
</script>
|
14
|
+
<%= render @suite.boot_partial %>
|
15
|
+
</head>
|
16
|
+
<body data-no-turbolink>
|
17
|
+
<%= render @suite.body_partial %>
|
18
|
+
</body>
|
19
|
+
</html>
|
data/bin/teaspoon
CHANGED
data/config/routes.rb
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Teaspoon::Engine.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
|
3
|
+
root to: "suite#index"
|
4
|
+
|
5
|
+
match "/fixtures/*filename",
|
6
|
+
to: "suite#fixtures", via: [:get]
|
7
|
+
|
8
|
+
match "/:suite", as: "suite",
|
9
|
+
to: "suite#show", via: [:get],
|
10
|
+
defaults: { suite: "default" }
|
11
|
+
|
12
|
+
match "/:suite/:hook", as: "suite_hook",
|
13
|
+
to: "suite#hook", via: [:get, :post],
|
14
|
+
defaults: { suite: "default", hook: "default" }
|
15
|
+
|
6
16
|
end
|