teabag 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -2
- data/app/assets/javascripts/teabag/base/reporters/console.coffee +1 -1
- data/app/assets/javascripts/teabag/base/teabag.coffee +1 -0
- data/app/assets/javascripts/teabag-jasmine.js +3 -1
- data/app/assets/javascripts/teabag-mocha.js +3 -1
- data/lib/generators/teabag/install/templates/initializer.rb +12 -61
- data/lib/teabag/configuration.rb +2 -2
- data/lib/teabag/formatters/base_formatter.rb +4 -0
- data/lib/teabag/formatters/progress_formatter.rb +3 -3
- data/lib/teabag/formatters/swayze_or_oprah_formatter.rb +71 -0
- data/lib/teabag/runner.rb +2 -2
- data/lib/teabag/version.rb +1 -1
- data/spec/dummy/log/development.log +3800 -0
- data/spec/dummy/log/test.log +80 -0
- data/spec/dummy/tmp/cache/assets/C4E/9B0/sprockets%2Fa807397434c9262c3d62da3e91152184 +0 -0
- data/spec/dummy/tmp/cache/assets/C75/D50/sprockets%2F5302968a40e08d2c011aa38666d273f6 +0 -0
- data/spec/dummy/tmp/cache/assets/C8A/460/sprockets%2F77bffd9959420103906722b404ae8d59 +0 -0
- data/spec/dummy/tmp/cache/assets/C91/FA0/sprockets%2F2eb81283f5789ae91a69344552db3856 +0 -0
- data/spec/dummy/tmp/cache/assets/CE1/730/sprockets%2Fa1678837061e18d7aca0286c07acf676 +0 -0
- data/spec/dummy/tmp/cache/assets/CE9/9E0/sprockets%2F135480d497ed7e4884462dc0ef0b80d7 +0 -0
- data/spec/dummy/tmp/cache/assets/CEB/680/sprockets%2F67f0794ef8c0576d5c7da34f4437305a +0 -0
- data/spec/dummy/tmp/cache/assets/D00/110/sprockets%2F6a6353b7723a8b21708e0fbfe04bd422 +0 -0
- data/spec/dummy/tmp/cache/assets/D35/7C0/sprockets%2Ff536a2606eaf7d542c0985104cb62baf +0 -0
- data/spec/dummy/tmp/cache/assets/D35/F00/sprockets%2F8e7f22358123b7eb5e21d17f442ce0ac +0 -0
- data/spec/dummy/tmp/cache/assets/D49/A10/sprockets%2Fc4656bd995a6f297c26d19b13aadb963 +0 -0
- data/spec/dummy/tmp/cache/assets/D50/D70/sprockets%2Fe2a3e6c95b11e0801a4eebae3a026026 +0 -0
- data/spec/dummy/tmp/cache/assets/D51/400/sprockets%2Ff5e433d8a31e80985b75ce598de236be +0 -0
- data/spec/dummy/tmp/cache/assets/D8C/520/sprockets%2F221cd58a042baac534d27e4cfedc1188 +0 -0
- data/spec/dummy/tmp/cache/assets/DA5/0A0/sprockets%2F7a4b5928cec69ab65afff309a04d6b47 +0 -0
- data/spec/dummy/tmp/cache/assets/DB5/040/sprockets%2F9a9da5df88713663b9fbc945facca891 +0 -0
- data/spec/dummy/tmp/cache/assets/DC7/A10/sprockets%2F84a8af0fcbf401864e1ae5bf092cba94 +0 -0
- data/spec/dummy/tmp/cache/assets/DEB/110/sprockets%2F2dbdab0ce5babca645cdb5780004f875 +0 -0
- data/spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 +0 -0
- data/spec/dummy/tmp/cache/assets/DFC/C30/sprockets%2Fb50a07cb30b0bd0eec8e98e5de79d65d +0 -0
- data/spec/dummy/tmp/cache/assets/E17/EF0/sprockets%2Fa291ad64a26afd055dfadabbdf03f154 +0 -0
- data/spec/javascripts/teabag/base/teabag_spec.coffee +13 -3
- data/spec/teabag/formatters/progress_formatter_spec.rb +4 -4
- data/spec/teabag/runner_spec.rb +6 -3
- metadata +5 -4
data/README.md
CHANGED
@@ -76,7 +76,7 @@ Create `app/assets/javascripts/calculator.coffee` and put this in it:
|
|
76
76
|
class @Calculator
|
77
77
|
```
|
78
78
|
|
79
|
-
Run `rake teabag` - you should see your first failing spec.
|
79
|
+
Run `rake teabag` - you should see your first failing spec.
|
80
80
|
|
81
81
|
```
|
82
82
|
Failures:
|
@@ -343,8 +343,16 @@ Timeout for starting the server in seconds. If your server is slow to start you
|
|
343
343
|
|
344
344
|
**default:** `20`
|
345
345
|
|
346
|
+
#### `formatters`
|
347
|
+
|
348
|
+
When running Teabag from the command line you can specify the formatters that it will use when displaying the results.
|
349
|
+
|
350
|
+
**Note:** override this directive by running `rake teabag FORMATTERS=progress,other_formatter`
|
351
|
+
|
352
|
+
**default:** `"progress"`
|
353
|
+
|
346
354
|
#### `fail_fast`
|
347
|
-
When you're running several suites it can be useful to make Teabag fail directly after any suite fails (not continuing on to the next suite), but in environments like CI this isn't as desirable. You can also configure this using the FAIL_FAST environment variable.
|
355
|
+
When you're running several suites it can be useful to make Teabag fail directly after any suite fails (not continuing on to the next suite), but in environments like CI this isn't as desirable. You can also configure this using the `FAIL_FAST` environment variable.
|
348
356
|
|
349
357
|
**Note:** override this directive by running `rake teabag FAIL_FAST=false`
|
350
358
|
|
@@ -402,6 +410,7 @@ So, there's lots of directions we can take the Teabag project, but we'll give it
|
|
402
410
|
|
403
411
|
- Ensure that the HTML reporter is working in IE6+ (give it a shot and let us know -- tested in IE9+).
|
404
412
|
|
413
|
+
- Provide fixture support that works across frameworks.
|
405
414
|
|
406
415
|
## License
|
407
416
|
|
@@ -2620,6 +2620,8 @@ jasmine.version_= {
|
|
2620
2620
|
|
2621
2621
|
Teabag.location = window.location;
|
2622
2622
|
|
2623
|
+
Teabag.console = window.console;
|
2624
|
+
|
2623
2625
|
Teabag.execute = function() {
|
2624
2626
|
if (this.defer) {
|
2625
2627
|
this.defer = false;
|
@@ -2914,7 +2916,7 @@ jasmine.version_= {
|
|
2914
2916
|
obj = {};
|
2915
2917
|
}
|
2916
2918
|
obj["_teabag"] = true;
|
2917
|
-
return console.log(JSON.stringify(obj));
|
2919
|
+
return Teabag.console.log(JSON.stringify(obj));
|
2918
2920
|
};
|
2919
2921
|
|
2920
2922
|
return Console;
|
@@ -5017,6 +5017,8 @@
|
|
5017
5017
|
|
5018
5018
|
Teabag.location = window.location;
|
5019
5019
|
|
5020
|
+
Teabag.console = window.console;
|
5021
|
+
|
5020
5022
|
Teabag.execute = function() {
|
5021
5023
|
if (this.defer) {
|
5022
5024
|
this.defer = false;
|
@@ -5311,7 +5313,7 @@
|
|
5311
5313
|
obj = {};
|
5312
5314
|
}
|
5313
5315
|
obj["_teabag"] = true;
|
5314
|
-
return console.log(JSON.stringify(obj));
|
5316
|
+
return Teabag.console.log(JSON.stringify(obj));
|
5315
5317
|
};
|
5316
5318
|
|
5317
5319
|
return Console;
|
@@ -1,59 +1,21 @@
|
|
1
1
|
Teabag.setup do |config|
|
2
2
|
|
3
|
-
# Mounting / Route
|
4
3
|
# This determines where the Teabag spec path will be mounted. Changing this to `"/jasmine"` would allow you to browse
|
5
4
|
# to `http://localhost:3000/jasmine` to run your specs.
|
6
|
-
#
|
7
|
-
# default: "/teabag"
|
8
5
|
config.mount_at = "/teabag"
|
9
6
|
|
10
|
-
# Root
|
11
7
|
# The root path defaults to Rails.root if left nil, but if you're testing an engine using a dummy application it's
|
12
8
|
# useful to be able to set this to your engines root.. E.g. `Teabag::Engine.root`
|
13
|
-
#
|
14
|
-
# default: nil, which forces defaulting to Rails.root
|
15
9
|
config.root = nil
|
16
10
|
|
17
|
-
# Asset paths
|
18
11
|
# These paths are appended to the rails assets paths (relative to config.root), and by default is an array that you
|
19
12
|
# can replace or add to.
|
20
|
-
|
21
|
-
# default: ["spec/javascripts", "spec/javascripts/stylesheets"]
|
22
|
-
config.asset_paths << "app/assets/some_other_path"
|
13
|
+
config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets"]
|
23
14
|
|
24
|
-
# Fixtures
|
25
15
|
# Fixtures are different than the specs, in that Rails is rendering them directly through a controller. This means you
|
26
16
|
# can use haml, erb builder, rabl, etc. to render content in the views available in this path.
|
27
|
-
#
|
28
|
-
# default: "spec/javascripts/fixtures"
|
29
17
|
config.fixture_path = "spec/javascripts/fixtures"
|
30
18
|
|
31
|
-
# Server timeout
|
32
|
-
# Timeout for starting the server in seconds. If your server is slow to start you may have to bump the timeout, or you
|
33
|
-
# may want to lower this if you know it shouldn't take long to start.
|
34
|
-
#
|
35
|
-
# default: 20
|
36
|
-
config.server_timeout = 20
|
37
|
-
|
38
|
-
# Failing Fast
|
39
|
-
# When you're running several suites it can be useful to make Teabag fail directly after any suite fails (not
|
40
|
-
# continuing on to the next suite), but in environments like CI this isn't as desirable. You can also configure this
|
41
|
-
# using the fail_fast environment variable.
|
42
|
-
#
|
43
|
-
# default: true
|
44
|
-
# Note: override this directive by running `rake teabag fail_fast=false`
|
45
|
-
config.fail_fast = true
|
46
|
-
|
47
|
-
# Suppressing Logs
|
48
|
-
# When you run Teabag from the console, it will pipe all console.log/debug/etc. calls to the console. This is useful
|
49
|
-
# to catch places where you've forgotten to remove console.log calls, but in verbose applications that use logging
|
50
|
-
# heavily this may not be desirable.
|
51
|
-
#
|
52
|
-
# default: false
|
53
|
-
# Note: override this directive by running `rake teabag suppress_log=true`
|
54
|
-
config.suppress_log = false
|
55
|
-
|
56
|
-
# Suites
|
57
19
|
# You can modify the default suite configuration or create new suites here. Suites can be entirely isolated from one
|
58
20
|
# another. When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed.
|
59
21
|
# When defining suites, you can omit various directives and the defaults will be used.
|
@@ -63,53 +25,42 @@ Teabag.setup do |config|
|
|
63
25
|
# - from the command line: rake teabag suite=[suite_name]
|
64
26
|
config.suite do |suite|
|
65
27
|
|
66
|
-
#
|
67
|
-
#
|
68
|
-
# is run. It's important that these files are serve-able from sprockets (aka the asset pipeline), otherwise you'll
|
69
|
-
# receive a warning about it.
|
28
|
+
# You can specify a file matcher for your specs and the matching files will be automatically loaded when the suite
|
29
|
+
# is run. It's important that these files are serve-able from sprockets (aka the asset pipeline).
|
70
30
|
#
|
71
|
-
# default: "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
|
72
31
|
# Note: set to nil if you want to load your spec files using a manifest from within the spec helper file.
|
73
32
|
suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
|
74
33
|
|
75
|
-
# Spec Helper
|
76
34
|
# Each suite can load a different spec helper, which can in turn require additional files since this file is also
|
77
35
|
# served via the asset pipeline. This file is loaded before your specs are loaded -- so could potentially include
|
78
36
|
# all of your specs (if you set the matcher to nil).
|
79
|
-
#
|
80
|
-
# default: "spec_helper"
|
81
37
|
suite.helper = "spec_helper"
|
82
38
|
|
83
|
-
# Javascripts
|
84
39
|
# These are the core Teabag javascripts. Spec files should not go here -- but if you want to add additional support
|
85
40
|
# for jasmine matchers, switch to mocha, include expectation libraries etc., this is a good place to do that.
|
86
41
|
#
|
87
|
-
# To use mocha
|
42
|
+
# To use mocha:
|
88
43
|
# "teabag-mocha"
|
89
44
|
#
|
90
45
|
# To use the coffeescript source files:
|
91
46
|
# "teabag/jasmine" or "teabag/mocha"
|
92
|
-
#
|
93
|
-
# default: ["teabag-jasmine"]
|
94
47
|
suite.javascripts = ["teabag-jasmine"]
|
95
48
|
|
96
|
-
# Stylesheets
|
97
49
|
# If you want to change how Teabag looks, or include your own stylesheets you can do that here. The default is the
|
98
50
|
# stylesheet for the HTML reporter.
|
99
|
-
#
|
100
|
-
# default: ["teabag"]
|
101
51
|
suite.stylesheets = ["teabag"]
|
102
52
|
end
|
103
53
|
|
104
|
-
#
|
105
|
-
#
|
106
|
-
# suite.
|
107
|
-
#
|
108
|
-
# To run this suite
|
109
|
-
# - in the browser: http://localhost/teabag/targeted
|
110
|
-
# - from the command line: rake teabag suite=targeted
|
54
|
+
# Example suite. Since we're actually just filtering specs to files already within the root spec/javascripts, these
|
55
|
+
# files will also be run in the default suite -- but can be focused into a more specific suite.
|
111
56
|
#config.suite :targeted do |suite|
|
112
57
|
# suite.matcher = "spec/javascripts/targeted/*_spec.{js,js.coffee,coffee}"
|
113
58
|
#end
|
114
59
|
|
60
|
+
# When Teabag is run from the command line these configuration directives apply.
|
61
|
+
#config.formatters = "progress"
|
62
|
+
#config.server_timeout = 20
|
63
|
+
#config.fail_fast = true
|
64
|
+
#config.suppress_log = false
|
65
|
+
|
115
66
|
end if defined?(Teabag) && Teabag.respond_to?(:setup) # let Teabag be undefined outside of development/test/asset groups
|
data/lib/teabag/configuration.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "singleton"
|
2
|
-
require "teabag/formatters/progress_formatter"
|
3
2
|
|
4
3
|
module Teabag
|
5
4
|
class Configuration
|
@@ -16,7 +15,6 @@ module Teabag
|
|
16
15
|
|
17
16
|
# console runner specific
|
18
17
|
@@formatters = "progress"
|
19
|
-
@@default_formatter = Teabag::Formatters::ProgressFormatter
|
20
18
|
@@server_timeout = 20
|
21
19
|
@@fail_fast = true
|
22
20
|
@@suppress_log = false
|
@@ -45,6 +43,8 @@ module Teabag
|
|
45
43
|
end
|
46
44
|
end
|
47
45
|
|
46
|
+
autoload :Formatters, "teabag/formatters/base_formatter"
|
47
|
+
|
48
48
|
mattr_accessor :configuration
|
49
49
|
@@configuration = Configuration
|
50
50
|
|
@@ -1,5 +1,9 @@
|
|
1
1
|
module Teabag
|
2
2
|
module Formatters
|
3
|
+
|
4
|
+
autoload :ProgressFormatter, 'teabag/formatters/progress_formatter'
|
5
|
+
autoload :SwayzeOrOprahFormatter, 'teabag/formatters/swayze_or_oprah_formatter'
|
6
|
+
|
3
7
|
class BaseFormatter
|
4
8
|
|
5
9
|
attr_accessor :total, :passes, :pendings, :failures, :errors
|
@@ -59,8 +59,8 @@ module Teabag
|
|
59
59
|
def failure_log
|
60
60
|
log "Failures:\n"
|
61
61
|
failures.each_with_index do |failure, index|
|
62
|
-
log "\n #{index + 1}) #{failure
|
63
|
-
log " Failure/Error: #{failure
|
62
|
+
log "\n #{index + 1}) #{failure.full_description}\n"
|
63
|
+
log " Failure/Error: #{failure.message}\n", RED
|
64
64
|
end
|
65
65
|
log "\n"
|
66
66
|
end
|
@@ -76,7 +76,7 @@ module Teabag
|
|
76
76
|
def pending_log
|
77
77
|
log "Pending:"
|
78
78
|
pendings.each do |result|
|
79
|
-
log "\n #{result.
|
79
|
+
log "\n #{result.full_description}\n", YELLOW
|
80
80
|
log " # Not yet implemented\n", CYAN
|
81
81
|
end
|
82
82
|
log "\n"
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Teabag
|
2
|
+
module Formatters
|
3
|
+
class SwayzeOrOprahFormatter < BaseFormatter
|
4
|
+
|
5
|
+
def results(results)
|
6
|
+
quote = QUOTES[Random.rand(QUOTES.size)]
|
7
|
+
STDOUT.print("\n#{quote.inspect} -- Oprah Winfrey or Patrick Swayze?\n")
|
8
|
+
end
|
9
|
+
|
10
|
+
QUOTES = [
|
11
|
+
# patrick swayze
|
12
|
+
"When those you love die, the best you can do is honor their spirit for as long as you live. You make a commitment that you're going to take whatever lesson that person or animal was trying to teach you, and you make it true in your own life... it's a positive way to keep their spirit alive in the world, by keeping it alive in yourself.",
|
13
|
+
"The way to screw up somebody's life is to give them what they want.",
|
14
|
+
"There's just something about dance ... It's like a primal thing in all of us.",
|
15
|
+
"Pain don't hurt.",
|
16
|
+
"What winning is to me is not giving up, is no matter what's thrown at me, I can take it. And I can keep going.",
|
17
|
+
"Good-looking people turn me off. Myself included.",
|
18
|
+
"One thing I'm not going to do is chase staying alive. You spend so much time chasing staying alive, you won't live.",
|
19
|
+
"The way to screw up somebody's life is to give them what they want.",
|
20
|
+
"There's just something about dance. It's like a primal thing in all of us.",
|
21
|
+
"As always, I appreciate all the love and support people have sent and continue to send my way.",
|
22
|
+
"Everything is designed to help you sell out.",
|
23
|
+
"How do you nurture a positive attitude when all the statistics say you're a dead man? You go to work.",
|
24
|
+
"I am very, very clear on how difficult it is for a young kid out there to go into the arts without taking a lot of heat from his peers.",
|
25
|
+
"I don't know how many hills and valleys I've had, how many times I've had to refocus my world and my life and my career.",
|
26
|
+
"I don't know what's on the other side.",
|
27
|
+
"I don't want to be a poster child for cancer.",
|
28
|
+
"I don't want to be Mr. Romantic Leading Man. I don't want to be the Dance Dude. I don't want to be the Action Guy. If I had to do any one of those all my life, it'd drive me crazy.",
|
29
|
+
"I dropped about 20 pounds in the blink of an eye. And then when you see it in the mirror, when all of a sudden you pull your eyes down, and the bottom of your eyes go yellow and jaundice sets in - then you know something's wrong.",
|
30
|
+
"I got completely fed up with that Hollywood blockbuster mentality. I couldn't take it seriously any longer.",
|
31
|
+
"I had a lot of anger because I wasn't happy with the way I had been raised.",
|
32
|
+
"I just love to work hard.",
|
33
|
+
"I keep dreaming of a future, a future with a long and healthy life, not lived in the shadow of cancer but in the light.",
|
34
|
+
"I keep my heart and my soul and my spirit open to miracles.",
|
35
|
+
"I like to believe that I've got a lot of guardian warriors sittin' on my shoulder including my dad.",
|
36
|
+
"I took after my father.",
|
37
|
+
"I wanna live.",
|
38
|
+
"I will go so far as to say probably smoking had something to do with my pancreatic cancer.",
|
39
|
+
"I'm trying to shut up and let my angels speak to me and tell me what I'm supposed to do.",
|
40
|
+
"I've had so many injuries.",
|
41
|
+
|
42
|
+
# oprah winfrey
|
43
|
+
"Lots of people want to ride with you in the limo, but what you want is someone who will take the bus with you when the limo breaks down.",
|
44
|
+
"Be thankful for what you have; you'll end up having more. If you concentrate on what you don't have, you will never, ever have enough.",
|
45
|
+
"The more you praise and celebrate your life, the more there is in life to celebrate.",
|
46
|
+
"Surround yourself with only people who are going to lift you higher.",
|
47
|
+
"Breathe. Let go. And remind yourself that this very moment is the only one you know you have for sure.",
|
48
|
+
"As you become more clear about who you really are, you'll be better able to decide what is best for you - the first time around.",
|
49
|
+
"It isn't until you come to a spiritual understanding of who you are - not necessarily a religious feeling, but deep down, the spirit within - that you can begin to take control.",
|
50
|
+
"I am a woman in process. I'm just trying like everybody else. I try to take every conflict, every experience, and learn from it. Life is never dull.",
|
51
|
+
"Turn your wounds into wisdom.",
|
52
|
+
"Doing the best at this moment puts you in the best place for the next moment.",
|
53
|
+
"Where there is no struggle, there is no strength.",
|
54
|
+
"Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire. This is your moment. Own it.",
|
55
|
+
"Passion is energy. Feel the power that comes from focusing on what excites you.",
|
56
|
+
"I don't think of myself as a poor deprived ghetto girl who made good. I think of myself as somebody who from an early age knew I was responsible for myself, and I had to make good.",
|
57
|
+
"Think like a queen. A queen is not afraid to fail. Failure is another steppingstone to greatness.",
|
58
|
+
"I believe that every single event in life happens in an opportunity to choose love over fear.",
|
59
|
+
"The greatest discovery of all time is that a person can change his future by merely changing his attitude.",
|
60
|
+
"I don't believe in failure. It is not failure if you enjoyed the process.",
|
61
|
+
"I don't think you ever stop giving. I really don't. I think it's an on-going process. And it's not just about being able to write a check. It's being able to touch somebody's life.",
|
62
|
+
"The struggle of my life created empathy - I could relate to pain, being abandoned, having people not love me.",
|
63
|
+
"What material success does is provide you with the ability to concentrate on other things that really matter. And that is being able to make a difference, not only in your own life, but in other people's lives.",
|
64
|
+
"Books were my pass to personal freedom. I learned to read at age three, and soon discovered there was a whole world to conquer that went beyond our farm in Mississippi.",
|
65
|
+
"Biology is the least of what makes someone a mother.",
|
66
|
+
"Real integrity is doing the right thing, knowing that nobody's going to know whether you did it or not.",
|
67
|
+
"I have a lot of things to prove to myself. One is that I can live my life fearlessly."
|
68
|
+
]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/lib/teabag/runner.rb
CHANGED
@@ -9,7 +9,7 @@ module Teabag
|
|
9
9
|
|
10
10
|
def initialize(suite_name = :default)
|
11
11
|
@suite_name = suite_name
|
12
|
-
@formatters = Teabag.configuration.formatters.split(
|
12
|
+
@formatters = Teabag.configuration.formatters.split(/,\s+/).map{ |f| resolve_formatter(f).new }
|
13
13
|
@failure_count = 0
|
14
14
|
end
|
15
15
|
|
@@ -21,7 +21,7 @@ module Teabag
|
|
21
21
|
private
|
22
22
|
|
23
23
|
def resolve_formatter(formatter)
|
24
|
-
Teabag::Formatters.const_get("#{formatter.to_s.
|
24
|
+
Teabag::Formatters.const_get("#{formatter.to_s.camelize}Formatter")
|
25
25
|
end
|
26
26
|
|
27
27
|
def output_from(line)
|
data/lib/teabag/version.rb
CHANGED