teaspoon 0.9.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +141 -0
- data/README.md +9 -19
- data/{vendor → app}/assets/javascripts/support/bind-poly.js +0 -0
- data/{vendor → app}/assets/javascripts/support/sinon.js +0 -0
- data/app/assets/javascripts/teaspoon-filterer.js +55 -0
- data/app/assets/javascripts/teaspoon/error.coffee +5 -0
- data/app/assets/javascripts/teaspoon/{base/fixture.coffee → fixture.coffee} +15 -15
- data/app/assets/javascripts/teaspoon/{base/hook.coffee → hook.coffee} +0 -0
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/console.coffee +18 -10
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html.coffee +43 -40
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/base_view.coffee +0 -0
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/failure_view.coffee +2 -0
- data/app/assets/javascripts/teaspoon/reporters/html/progress_view.coffee +18 -0
- data/app/assets/javascripts/teaspoon/{base/reporters/html/progress_view.coffee → reporters/html/radial_progress_view.coffee} +1 -34
- data/app/assets/javascripts/teaspoon/reporters/html/simple_progress_view.coffee +15 -0
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/spec_view.coffee +5 -3
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/suite_view.coffee +4 -2
- data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/template.coffee +0 -0
- data/app/assets/javascripts/teaspoon/{base/runner.coffee → runner.coffee} +7 -3
- data/app/assets/javascripts/teaspoon/teaspoon.coffee +90 -32
- data/app/controllers/teaspoon/suite_controller.rb +5 -0
- data/app/views/teaspoon/suite/index.html.erb +1 -1
- data/lib/generators/teaspoon/install/install_generator.rb +67 -37
- data/lib/generators/teaspoon/install/templates/MISSING_FRAMEWORK +14 -0
- data/lib/generators/teaspoon/install/{POST_INSTALL → templates/POST_INSTALL} +0 -0
- data/lib/generators/teaspoon/install/templates/env.rb.tt +14 -0
- data/lib/generators/teaspoon/install/templates/{jasmine/env_comments.rb.tt → env_comments.rb.tt} +34 -43
- data/lib/tasks/teaspoon/info.rake +17 -0
- data/lib/teaspoon-devkit.rb +61 -0
- data/lib/teaspoon.rb +2 -0
- data/lib/teaspoon/command_line.rb +19 -14
- data/lib/teaspoon/configuration.rb +24 -35
- data/lib/teaspoon/console.rb +11 -21
- data/lib/teaspoon/coverage.rb +14 -7
- data/lib/teaspoon/deprecated.rb +22 -4
- data/lib/teaspoon/driver.rb +15 -0
- data/lib/teaspoon/driver/base.rb +7 -0
- data/lib/teaspoon/{drivers/capybara_webkit_driver.rb → driver/capybara_webkit.rb} +8 -5
- data/lib/teaspoon/{drivers/phantomjs_driver.rb → driver/phantomjs.rb} +8 -4
- data/lib/teaspoon/{drivers → driver}/phantomjs/runner.js +0 -0
- data/lib/teaspoon/{drivers/selenium_driver.rb → driver/selenium.rb} +11 -9
- data/lib/teaspoon/engine.rb +38 -25
- data/lib/teaspoon/environment.rb +24 -15
- data/lib/teaspoon/exceptions.rb +154 -41
- data/lib/teaspoon/exporter.rb +2 -2
- data/lib/teaspoon/formatter.rb +30 -0
- data/lib/teaspoon/{formatters → formatter}/base.rb +2 -36
- data/lib/teaspoon/{formatters/clean_formatter.rb → formatter/clean.rb} +4 -2
- data/lib/teaspoon/{formatters/documentation_formatter.rb → formatter/documentation.rb} +4 -3
- data/lib/teaspoon/{formatters/dot_formatter.rb → formatter/dot.rb} +4 -3
- data/lib/teaspoon/{formatters/json_formatter.rb → formatter/json.rb} +4 -2
- data/lib/teaspoon/{formatters/junit_formatter.rb → formatter/junit.rb} +3 -2
- data/lib/teaspoon/{formatters → formatter}/modules/report_module.rb +1 -1
- data/lib/teaspoon/{formatters/pride_formatter.rb → formatter/pride.rb} +4 -2
- data/lib/teaspoon/{formatters/rspec_html_formatter.rb → formatter/rspec_html.rb} +3 -2
- data/lib/teaspoon/{formatters/snowday_formatter.rb → formatter/snowday.rb} +3 -2
- data/lib/teaspoon/formatter/swayze_or_oprah.rb +111 -0
- data/lib/teaspoon/{formatters/tap_formatter.rb → formatter/tap.rb} +4 -2
- data/lib/teaspoon/{formatters/tap_y_formatter.rb → formatter/tap_y.rb} +3 -2
- data/lib/teaspoon/{formatters/teamcity_formatter.rb → formatter/teamcity.rb} +4 -2
- data/lib/teaspoon/framework.rb +17 -0
- data/lib/teaspoon/framework/base.rb +88 -0
- data/lib/teaspoon/instrumentation.rb +12 -2
- data/lib/teaspoon/registry.rb +47 -0
- data/lib/teaspoon/registry/has_default.rb +11 -0
- data/lib/teaspoon/runner.rb +6 -7
- data/lib/teaspoon/server.rb +2 -2
- data/lib/teaspoon/suite.rb +28 -30
- data/lib/teaspoon/utility.rb +5 -0
- data/lib/teaspoon/version.rb +1 -1
- metadata +52 -276
- data/app/assets/javascripts/teaspoon-jasmine.js +0 -1344
- data/app/assets/javascripts/teaspoon-mocha.js +0 -1350
- data/app/assets/javascripts/teaspoon-qunit.js +0 -1415
- data/app/assets/javascripts/teaspoon-teaspoon.js +0 -51
- data/app/assets/javascripts/teaspoon/base/teaspoon.coffee +0 -69
- data/app/assets/javascripts/teaspoon/jasmine.coffee +0 -119
- data/app/assets/javascripts/teaspoon/jasmine/reporters/html.coffee +0 -11
- data/app/assets/javascripts/teaspoon/mocha.coffee +0 -90
- data/app/assets/javascripts/teaspoon/mocha/reporters/console.coffee +0 -16
- data/app/assets/javascripts/teaspoon/mocha/reporters/html.coffee +0 -27
- data/app/assets/javascripts/teaspoon/qunit.coffee +0 -81
- data/app/assets/javascripts/teaspoon/qunit/reporters/console.coffee +0 -25
- data/app/assets/javascripts/teaspoon/qunit/reporters/html.coffee +0 -80
- data/lib/generators/teaspoon/install/templates/jasmine/env.rb +0 -11
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee +0 -31
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.js +0 -31
- data/lib/generators/teaspoon/install/templates/mocha/env.rb +0 -11
- data/lib/generators/teaspoon/install/templates/mocha/env_comments.rb.tt +0 -187
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee +0 -40
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.js +0 -40
- data/lib/generators/teaspoon/install/templates/qunit/env.rb +0 -11
- data/lib/generators/teaspoon/install/templates/qunit/env_comments.rb.tt +0 -187
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.coffee +0 -29
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.js +0 -30
- data/lib/teaspoon/drivers/base.rb +0 -10
- data/lib/teaspoon/formatters/description.rb +0 -36
- data/lib/teaspoon/formatters/swayze_or_oprah_formatter.rb +0 -101
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/instrumented1.coffee +0 -1
- data/spec/dummy/app/assets/javascripts/instrumented2.coffee +0 -1
- data/spec/dummy/app/assets/javascripts/integration/integration.coffee +0 -1
- data/spec/dummy/app/assets/javascripts/integration/integration_spec.coffee +0 -32
- data/spec/dummy/app/assets/javascripts/integration/spec_helper.coffee +0 -7
- data/spec/dummy/app/assets/javascripts/specs/asset_spec.js +0 -11
- data/spec/dummy/config.ru +0 -15
- data/spec/dummy/config/application.rb +0 -29
- data/spec/dummy/config/boot.rb +0 -3
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -41
- data/spec/dummy/config/environments/production.rb +0 -79
- data/spec/dummy/config/environments/test.rb +0 -42
- data/spec/dummy/config/routes.rb +0 -2
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/features/console_reporter_spec.rb +0 -62
- data/spec/features/hooks_spec.rb +0 -60
- data/spec/features/html_reporter_spec.rb +0 -81
- data/spec/features/install_generator_spec.rb +0 -54
- data/spec/features/instrumentation_spec.rb +0 -21
- data/spec/fixtures/coverage.json +0 -243
- data/spec/javascripts/fixtures/_body.html.erb +0 -1
- data/spec/javascripts/fixtures/fixture.html.haml +0 -4
- data/spec/javascripts/fixtures/fixture.json +0 -4
- data/spec/javascripts/jasmine_helper.coffee +0 -3
- data/spec/javascripts/mocha_helper.coffee +0 -4
- data/spec/javascripts/spec_helper.coffee +0 -7
- data/spec/javascripts/stylesheets/stylesheet.css.scss +0 -0
- data/spec/javascripts/support/json2.js +0 -486
- data/spec/javascripts/support/support.js.coffee +0 -0
- data/spec/javascripts/teaspoon/base/fixture_spec.coffee +0 -93
- data/spec/javascripts/teaspoon/base/reporters/console_spec.coffee +0 -162
- data/spec/javascripts/teaspoon/base/reporters/html/base_view_spec.coffee +0 -88
- data/spec/javascripts/teaspoon/base/reporters/html/failure_view_spec.coffee +0 -28
- data/spec/javascripts/teaspoon/base/reporters/html/progress_view_spec.coffee +0 -1
- data/spec/javascripts/teaspoon/base/reporters/html/spec_view_spec.coffee +0 -1
- data/spec/javascripts/teaspoon/base/reporters/html/suite_view_spec.coffee +0 -1
- data/spec/javascripts/teaspoon/base/reporters/html_spec.coffee +0 -372
- data/spec/javascripts/teaspoon/base/runner_spec.coffee +0 -58
- data/spec/javascripts/teaspoon/base/teaspoon_spec.coffee +0 -47
- data/spec/javascripts/teaspoon/jasmine/fixture_jspec.coffee +0 -13
- data/spec/javascripts/teaspoon/jasmine/models_jspec.coffee +0 -101
- data/spec/javascripts/teaspoon/jasmine/reporters/html_jspec.coffee +0 -17
- data/spec/javascripts/teaspoon/jasmine/runner_jspec.coffee +0 -59
- data/spec/javascripts/teaspoon/jasmine/spec_jspec.coffee +0 -3
- data/spec/javascripts/teaspoon/mocha/fixture_mspec.coffee +0 -12
- data/spec/javascripts/teaspoon/mocha/models_mspec.coffee +0 -93
- data/spec/javascripts/teaspoon/mocha/reporters/console_mspec.coffee +0 -24
- data/spec/javascripts/teaspoon/mocha/reporters/html_mspec.coffee +0 -41
- data/spec/javascripts/teaspoon/mocha/runner_mspec.coffee +0 -23
- data/spec/javascripts/teaspoon/mocha/spec_mspec.coffee +0 -9
- data/spec/javascripts/teaspoon/other/erb_spec.js.coffee.erb +0 -4
- data/spec/javascripts/teaspoon/phantomjs/runner_spec.coffee +0 -161
- data/spec/javascripts/turbolinks_helper.coffee +0 -2
- data/spec/spec_helper.rb +0 -25
- data/spec/support/aruba.rb +0 -15
- data/spec/teaspoon/command_line_spec.rb +0 -157
- data/spec/teaspoon/configuration_spec.rb +0 -236
- data/spec/teaspoon/console_spec.rb +0 -224
- data/spec/teaspoon/coverage_spec.rb +0 -118
- data/spec/teaspoon/drivers/base_spec.rb +0 -5
- data/spec/teaspoon/drivers/capybara_webkit_driver_spec.rb +0 -39
- data/spec/teaspoon/drivers/phantomjs_driver_spec.rb +0 -66
- data/spec/teaspoon/drivers/selenium_driver_spec.rb +0 -68
- data/spec/teaspoon/engine_spec.rb +0 -22
- data/spec/teaspoon/environment_spec.rb +0 -109
- data/spec/teaspoon/exceptions_spec.rb +0 -57
- data/spec/teaspoon/exporter_spec.rb +0 -96
- data/spec/teaspoon/formatters/base_spec.rb +0 -259
- data/spec/teaspoon/formatters/clean_formatter_spec.rb +0 -37
- data/spec/teaspoon/formatters/documentation_formatter_spec.rb +0 -127
- data/spec/teaspoon/formatters/dot_formatter_spec.rb +0 -116
- data/spec/teaspoon/formatters/json_formatter_spec.rb +0 -77
- data/spec/teaspoon/formatters/junit_formatter_spec.rb +0 -114
- data/spec/teaspoon/formatters/pride_formatter_spec.rb +0 -37
- data/spec/teaspoon/formatters/rspec_html_formatter_spec.rb +0 -107
- data/spec/teaspoon/formatters/snowday_formatter_spec.rb +0 -35
- data/spec/teaspoon/formatters/tap_formatter_spec.rb +0 -72
- data/spec/teaspoon/formatters/tap_y_formatter_spec.rb +0 -80
- data/spec/teaspoon/formatters/teamcity_formatter_spec.rb +0 -148
- data/spec/teaspoon/instrumentation_spec.rb +0 -113
- data/spec/teaspoon/result_spec.rb +0 -98
- data/spec/teaspoon/runner_spec.rb +0 -116
- data/spec/teaspoon/server_spec.rb +0 -105
- data/spec/teaspoon/suite_spec.rb +0 -138
- data/spec/teaspoon_env.rb +0 -39
- data/test/javascripts/qunit_helper.coffee +0 -3
- data/test/javascripts/teaspoon/qunit/fixture_test.coffee +0 -10
- data/test/javascripts/teaspoon/qunit/models_test.coffee +0 -66
- data/test/javascripts/teaspoon/qunit/reporters/console_test.coffee +0 -3
- data/test/javascripts/teaspoon/qunit/reporters/html/failure_view_test.coffee +0 -3
- data/test/javascripts/teaspoon/qunit/reporters/html/spec_view_test.coffee +0 -3
- data/test/javascripts/teaspoon/qunit/reporters/html/suite_view_test.coffee +0 -3
- data/test/javascripts/teaspoon/qunit/reporters/html_test.coffee +0 -3
- data/test/javascripts/teaspoon/qunit/runner_test.coffee +0 -18
- data/vendor/assets/javascripts/jasmine/1.3.1.js +0 -2602
- data/vendor/assets/javascripts/jasmine/2.0.0.js +0 -2412
- data/vendor/assets/javascripts/jasmine/MIT.LICENSE +0 -20
- data/vendor/assets/javascripts/mocha/1.10.0.js +0 -5374
- data/vendor/assets/javascripts/mocha/1.17.1.js +0 -5813
- data/vendor/assets/javascripts/mocha/MIT.LICENSE +0 -22
- data/vendor/assets/javascripts/qunit/1.12.0.js +0 -2212
- data/vendor/assets/javascripts/qunit/1.14.0.js +0 -2288
- data/vendor/assets/javascripts/qunit/MIT.LICENSE +0 -21
- data/vendor/assets/javascripts/support/chai-1.10.0.js +0 -4800
- data/vendor/assets/javascripts/support/chai-jq-0.0.7.js +0 -524
- data/vendor/assets/javascripts/support/chai.js +0 -4782
- data/vendor/assets/javascripts/support/expect.js +0 -1284
- data/vendor/assets/javascripts/support/jasmine-jquery-1.7.0.js +0 -720
- data/vendor/assets/javascripts/support/jasmine-jquery-2.0.0.js +0 -812
- data/vendor/assets/javascripts/support/sinon-chai.js +0 -126
@@ -1,37 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Teaspoon::Formatters::CleanFormatter do
|
4
|
-
|
5
|
-
let(:passing_spec) { double(passing?: true) }
|
6
|
-
let(:pending_spec) { double(passing?: false, pending?: true, description: "_description_") }
|
7
|
-
let(:failing_spec) { double(passing?: false, pending?: false, description: "_description_", message: "_message_", link: "_link_") }
|
8
|
-
|
9
|
-
before do
|
10
|
-
@log = ""
|
11
|
-
allow(STDOUT).to receive(:print) { |s| @log << s }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe "#result" do
|
15
|
-
|
16
|
-
let(:result) { double(elapsed: 3.1337, coverage: nil) }
|
17
|
-
|
18
|
-
before do
|
19
|
-
subject.run_count = 666
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "with failures" do
|
23
|
-
|
24
|
-
before do
|
25
|
-
subject.failures << failing_spec
|
26
|
-
end
|
27
|
-
|
28
|
-
it "logs the failures but not the failure commands" do
|
29
|
-
subject.result(result)
|
30
|
-
expect(@log).to eq("\n\nFailures:\n\n 1) _description_\n\e[31m Failure/Error: _message_\n\e[0m\nFinished in 3.1337 seconds\n\e[31m666 examples, 1 failure\e[0m\n")
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Teaspoon::Formatters::DocumentationFormatter do
|
4
|
-
|
5
|
-
let(:suite) { double(label: "_suite_", level: @level || 0)}
|
6
|
-
let(:passing_spec) { double(passing?: true, label: "_passing_") }
|
7
|
-
let(:pending_spec) { double(passing?: false, pending?: true, label: "_pending_", description: "_description_") }
|
8
|
-
let(:failing_spec) { double(passing?: false, pending?: false, label: "_failing_", description: "_description_", message: "_message_", link: "_link_") }
|
9
|
-
|
10
|
-
before do
|
11
|
-
@log = ""
|
12
|
-
allow(STDOUT).to receive(:print) { |s| @log << s }
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "#suite" do
|
16
|
-
|
17
|
-
it "logs a properly indented suite message" do
|
18
|
-
@level = 2
|
19
|
-
subject.suite(suite)
|
20
|
-
expect(@log).to eq(" _suite_\n")
|
21
|
-
expect(subject.instance_variable_get(:@level)).to eq(2)
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#spec" do
|
27
|
-
|
28
|
-
before do
|
29
|
-
subject.instance_variable_set(:@level, 1)
|
30
|
-
subject.instance_variable_set(:@last_suite, {})
|
31
|
-
subject.instance_variable_set(:@stdout, "line1\nline2\n")
|
32
|
-
end
|
33
|
-
|
34
|
-
it "logs an indented green label on passing results" do
|
35
|
-
subject.spec(passing_spec)
|
36
|
-
expect(@log).to eq("\e[32m _passing_\e[0m\n\e[36m # line1\n # line2\e[0m\n")
|
37
|
-
end
|
38
|
-
|
39
|
-
it "logs an indented yellow label on pending results" do
|
40
|
-
subject.instance_variable_set(:@level, 1)
|
41
|
-
subject.instance_variable_set(:@last_suite, {})
|
42
|
-
subject.spec(pending_spec)
|
43
|
-
expect(@log).to eq("\e[33m _pending_ (PENDING)\e[0m\n\e[36m # line1\n # line2\e[0m\n")
|
44
|
-
end
|
45
|
-
|
46
|
-
it "logs an indented red label (with stdout) on failing results" do
|
47
|
-
subject.spec(failing_spec)
|
48
|
-
expect(@log).to eq("\e[31m _failing_ (FAILED - 1)\e[0m\n\e[36m # line1\n # line2\e[0m\n")
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
describe "#error" do
|
54
|
-
|
55
|
-
let(:result) { double(message: "_message_", trace: [{"file" => "http://127.0.0.1:31337/assets/path/file.js?foo=true&body=1", "line" => 42, "function" => "notAnAnonFunc"}]) }
|
56
|
-
|
57
|
-
it "logs the error" do
|
58
|
-
subject.error(result)
|
59
|
-
expect(@log).to eq("\e[31m_message_\e[0m\n\e[36m # path/file.js?foo=true:42 -- notAnAnonFunc\e[0m\n\n")
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
describe "#result" do
|
65
|
-
|
66
|
-
let(:result) { double(elapsed: 3.1337, coverage: nil) }
|
67
|
-
|
68
|
-
before do
|
69
|
-
subject.run_count = 666
|
70
|
-
end
|
71
|
-
|
72
|
-
describe "with no failures" do
|
73
|
-
|
74
|
-
it "logs the stats" do
|
75
|
-
subject.result(result)
|
76
|
-
expect(@log).to eq("\nFinished in 3.1337 seconds\n\e[32m666 examples, 0 failures\e[0m\n")
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
describe "with failures" do
|
82
|
-
|
83
|
-
before do
|
84
|
-
subject.failures << failing_spec
|
85
|
-
end
|
86
|
-
|
87
|
-
it "logs the failures" do
|
88
|
-
subject.result(result)
|
89
|
-
expect(@log).to eq("\nFailures:\n\n 1) _description_\n\e[31m Failure/Error: _message_\n\e[0m\nFinished in 3.1337 seconds\n\e[31m666 examples, 1 failure\e[0m\n\nFailed examples:\n\n\e[31mteaspoon -s default --filter=\"_link_\"\e[0m\n")
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
93
|
-
|
94
|
-
describe "with pending" do
|
95
|
-
|
96
|
-
before do
|
97
|
-
subject.pendings << pending_spec
|
98
|
-
end
|
99
|
-
|
100
|
-
it "logs the pending specs" do
|
101
|
-
subject.result(result)
|
102
|
-
expect(@log).to eq("\nPending:\n\e[33m _description_\e[0m\n\e[36m # Not yet implemented\n\e[0m\nFinished in 3.1337 seconds\n\e[33m666 examples, 0 failures, 1 pending\e[0m\n")
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
end
|
108
|
-
|
109
|
-
describe "#coverage" do
|
110
|
-
|
111
|
-
it "logs the coverage" do
|
112
|
-
subject.coverage("_text_\n\n_text_summary_")
|
113
|
-
expect(@log).to eq("\n_text_\n\n_text_summary_\n")
|
114
|
-
end
|
115
|
-
|
116
|
-
end
|
117
|
-
|
118
|
-
describe "#threshold_failure" do
|
119
|
-
|
120
|
-
it "logs the threshold failures" do
|
121
|
-
subject.threshold_failure("_was_not_met_\n_was_not_met_")
|
122
|
-
expect(@log).to eq("\e[31m\n_was_not_met_\n_was_not_met_\n\e[0m\n")
|
123
|
-
end
|
124
|
-
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Teaspoon::Formatters::DotFormatter do
|
4
|
-
|
5
|
-
let(:passing_spec) { double(passing?: true) }
|
6
|
-
let(:pending_spec) { double(passing?: false, pending?: true, description: "_description_") }
|
7
|
-
let(:failing_spec) { double(passing?: false, pending?: false, description: "_description_", message: "_message_", link: "_link_") }
|
8
|
-
|
9
|
-
before do
|
10
|
-
@log = ""
|
11
|
-
allow(STDOUT).to receive(:print) { |s| @log << s }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe "#spec" do
|
15
|
-
|
16
|
-
it "logs a green . on passing results" do
|
17
|
-
subject.spec(passing_spec)
|
18
|
-
expect(@log).to eq("\e[32m.\e[0m")
|
19
|
-
end
|
20
|
-
|
21
|
-
it "logs a yellow * on pending results" do
|
22
|
-
subject.spec(pending_spec)
|
23
|
-
expect(@log).to eq("\e[33m*\e[0m")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "logs a red F on failing results" do
|
27
|
-
subject.spec(failing_spec)
|
28
|
-
expect(@log).to eq("\e[31mF\e[0m")
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "#error" do
|
34
|
-
|
35
|
-
let(:result) { double(message: "_message_", trace: [{"file" => "http://127.0.0.1:31337/assets/path/file.js?foo=true&body=1", "line" => 42, "function" => "notAnAnonFunc"}]) }
|
36
|
-
|
37
|
-
it "logs the error" do
|
38
|
-
subject.error(result)
|
39
|
-
expect(@log).to eq("\e[31m_message_\e[0m\n\e[36m # path/file.js?foo=true:42 -- notAnAnonFunc\e[0m\n\n")
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
describe "#console" do
|
45
|
-
|
46
|
-
it "logs the message" do
|
47
|
-
subject.console("_message_\n")
|
48
|
-
expect(@log).to eq("_message_\n")
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
describe "#result" do
|
54
|
-
|
55
|
-
let(:result) { double(elapsed: 3.1337, coverage: nil) }
|
56
|
-
|
57
|
-
before do
|
58
|
-
subject.run_count = 666
|
59
|
-
end
|
60
|
-
|
61
|
-
describe "with no failures" do
|
62
|
-
|
63
|
-
it "logs the stats" do
|
64
|
-
subject.result(result)
|
65
|
-
expect(@log).to eq("\n\nFinished in 3.1337 seconds\n\e[32m666 examples, 0 failures\e[0m\n")
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
describe "with failures" do
|
71
|
-
|
72
|
-
before do
|
73
|
-
subject.failures << failing_spec
|
74
|
-
end
|
75
|
-
|
76
|
-
it "logs the failures" do
|
77
|
-
subject.result(result)
|
78
|
-
expect(@log).to eq("\n\nFailures:\n\n 1) _description_\n\e[31m Failure/Error: _message_\n\e[0m\nFinished in 3.1337 seconds\n\e[31m666 examples, 1 failure\e[0m\n\nFailed examples:\n\n\e[31mteaspoon -s default --filter=\"_link_\"\e[0m\n")
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "with pending" do
|
84
|
-
|
85
|
-
before do
|
86
|
-
subject.pendings << pending_spec
|
87
|
-
end
|
88
|
-
|
89
|
-
it "logs the pending specs" do
|
90
|
-
subject.result(result)
|
91
|
-
expect(@log).to eq("\n\nPending:\n\e[33m _description_\e[0m\n\e[36m # Not yet implemented\n\e[0m\nFinished in 3.1337 seconds\n\e[33m666 examples, 0 failures, 1 pending\e[0m\n")
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
describe "#coverage" do
|
99
|
-
|
100
|
-
it "logs the coverage" do
|
101
|
-
subject.coverage("_text_\n\n_text_summary_")
|
102
|
-
expect(@log).to eq("\n_text_\n\n_text_summary_\n")
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
describe "#threshold_failure" do
|
108
|
-
|
109
|
-
it "logs the threshold failures" do
|
110
|
-
subject.threshold_failure("_was_not_met_\n_was_not_met_")
|
111
|
-
expect(@log).to eq("\e[31m\n_was_not_met_\n_was_not_met_\n\e[0m\n")
|
112
|
-
end
|
113
|
-
|
114
|
-
end
|
115
|
-
|
116
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Teaspoon::Formatters::JsonFormatter do
|
4
|
-
|
5
|
-
let(:hash) { {original_json: "_original_json_"} }
|
6
|
-
let(:result) { double(hash) }
|
7
|
-
|
8
|
-
describe "#runner" do
|
9
|
-
|
10
|
-
let(:result) { double(hash.merge(total: 42)) }
|
11
|
-
|
12
|
-
it "logs the original json" do
|
13
|
-
expect(subject).to receive(:log_result).with(result)
|
14
|
-
subject.runner(result)
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
describe "#suite" do
|
20
|
-
|
21
|
-
it "logs the original json" do
|
22
|
-
expect(subject).to receive(:log_result).with(result)
|
23
|
-
subject.suite(result)
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "#spec" do
|
29
|
-
|
30
|
-
let(:result) { double(hash.merge(passing?: true)) }
|
31
|
-
|
32
|
-
it "logs the original json" do
|
33
|
-
expect(subject).to receive(:log_result).with(result)
|
34
|
-
subject.spec(result)
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
describe "#error" do
|
40
|
-
|
41
|
-
it "logs the original json" do
|
42
|
-
expect(subject).to receive(:log_result).with(result)
|
43
|
-
subject.error(result)
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
describe "#exception" do
|
49
|
-
|
50
|
-
it "logs the original json" do
|
51
|
-
expect(subject).to receive(:log_result).with(result)
|
52
|
-
subject.exception(result)
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
describe "#console" do
|
58
|
-
|
59
|
-
it "logs the message as json" do
|
60
|
-
expect(subject).to receive(:log_line).with(%Q{{"type":"console","log":"_message_"}})
|
61
|
-
subject.console("_message_")
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
describe "#result" do
|
67
|
-
|
68
|
-
let(:result) { double(hash.merge(coverage: nil)) }
|
69
|
-
|
70
|
-
it "logs the original json" do
|
71
|
-
expect(subject).to receive(:log_str).with("_original_json_")
|
72
|
-
subject.result(result)
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
@@ -1,114 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Teaspoon::Formatters::JunitFormatter do
|
4
|
-
|
5
|
-
let(:passing_spec) { double(passing?: true, suite: "_suite_name_", label: "_passing_label_") }
|
6
|
-
let(:pending_spec) { double(passing?: false, pending?: true, suite: "_suite_name_", label: "_pending_label_") }
|
7
|
-
let(:failing_spec) { double(passing?: false, pending?: false, suite: "_suite&name_", label: "_failing&label_", message: "_failure_message_") }
|
8
|
-
|
9
|
-
before do
|
10
|
-
@log = ""
|
11
|
-
allow(STDOUT).to receive(:print) { |s| @log << s }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe "#runner" do
|
15
|
-
|
16
|
-
let(:result) { double(start: "_start_", total: 42) }
|
17
|
-
|
18
|
-
before do
|
19
|
-
subject.instance_variable_set(:@suite_name, "not_default&")
|
20
|
-
end
|
21
|
-
|
22
|
-
it "starts the suite" do
|
23
|
-
subject.runner(result)
|
24
|
-
expect(@log).to eq(%Q{<?xml version="1.0" encoding="UTF-8"?>\n<testsuites name="Teaspoon">\n<testsuite name="not_default&" tests="42" time="_start_">\n})
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#suite" do
|
30
|
-
|
31
|
-
let(:result) { double(label: "_suite>label_") }
|
32
|
-
|
33
|
-
it "calls #log_end_suite" do
|
34
|
-
expect(subject).to receive(:log_end_suite)
|
35
|
-
subject.suite(result)
|
36
|
-
end
|
37
|
-
|
38
|
-
it "logs the start of the testsuite" do
|
39
|
-
subject.suite(result)
|
40
|
-
expect(@log).to eq(%Q{<testsuite name="_suite>label_">\n})
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "#spec" do
|
46
|
-
|
47
|
-
it "logs a passing testcase on passing results" do
|
48
|
-
subject.spec(passing_spec)
|
49
|
-
expect(@log).to eq(%Q{<testcase classname="_suite_name_" name="_passing_label_">\n</testcase>\n})
|
50
|
-
end
|
51
|
-
|
52
|
-
it "logs a skipped testcase on pending results" do
|
53
|
-
subject.spec(pending_spec)
|
54
|
-
expect(@log).to eq(%Q{<testcase classname="_suite_name_" name="_pending_label_">\n <skipped/>\n</testcase>\n})
|
55
|
-
end
|
56
|
-
|
57
|
-
it "logs a failing testcase with the message on failing results" do
|
58
|
-
subject.spec(failing_spec)
|
59
|
-
expect(@log).to include(%Q{<testcase classname="_suite&name_" name="_failing&label_">\n})
|
60
|
-
expect(@log).to include(%Q{ <failure type="AssertionFailed">\n<![CDATA[\n_failure_message_\n]]>\n</failure>\n})
|
61
|
-
expect(@log).to include(%Q{</testcase>\n})
|
62
|
-
end
|
63
|
-
|
64
|
-
it "includes any stdout" do
|
65
|
-
subject.instance_variable_set(:@stdout, "_stdout_")
|
66
|
-
subject.spec(passing_spec)
|
67
|
-
expect(@log).to eq(%Q{<testcase classname="_suite_name_" name="_passing_label_">\n<system-out>\n<![CDATA[\n_stdout_\n]]>\n</system-out>\n</testcase>\n})
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
describe "#result" do
|
73
|
-
|
74
|
-
let(:result) { double(coverage: nil) }
|
75
|
-
|
76
|
-
it "closes the last suite" do
|
77
|
-
expect(subject).to receive(:log_end_suite)
|
78
|
-
subject.result(result)
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "#coverage" do
|
84
|
-
|
85
|
-
it "logs the coverage" do
|
86
|
-
subject.coverage("_text_\n\n_text_summary_")
|
87
|
-
expect(@log).to eq(%Q{<testsuite name="Coverage summary" tests="0">\n<properties>\n<![CDATA[\n_text_\n_text_summary_\n]]>\n</properties>\n</testsuite>\n})
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
describe "#threshold_failure" do
|
93
|
-
|
94
|
-
it "logs the threshold failures" do
|
95
|
-
subject.threshold_failure("_was_not_met_\n_was_not_met_")
|
96
|
-
expect(@log).to include(%Q{<testsuite name="Coverage thresholds" tests="1">\n})
|
97
|
-
expect(@log).to include(%Q{<testcase classname="Coverage thresholds" name="were not met">\n})
|
98
|
-
expect(@log).to include(%Q{ <failure type="AssertionFailed">\n<![CDATA[\n_was_not_met_\n_was_not_met_\n]]>\n</failure>\n})
|
99
|
-
expect(@log).to include(%Q{</testcase>\n})
|
100
|
-
expect(@log).to include(%Q{</testsuite>\n})
|
101
|
-
end
|
102
|
-
|
103
|
-
end
|
104
|
-
|
105
|
-
describe "#complete" do
|
106
|
-
|
107
|
-
it "logs the closing suite tags" do
|
108
|
-
subject.complete(2)
|
109
|
-
expect(@log).to include(%Q{</testsuite>\n</testsuites>})
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
end
|