riot 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ *0.12.1*
2
+
3
+ * Error reporting now filters the backtrace to include only meaningful line items. [mbriggs]
4
+
5
+ * Added ability to pass method arguments to asserts. [sirupsen]
6
+
1
7
  *0.12.0*
2
8
 
3
9
  * Negative tests are finally here! Added support for `denies` and adjusted macros to care about it with `devaluate`. [jaknowlden, achiu]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.0
1
+ 0.12.1
@@ -122,6 +122,9 @@ module Riot
122
122
  if what.kind_of?(Symbol)
123
123
  definition ||= proc { topic.send(what) }
124
124
  description = "#{scope} ##{what}"
125
+ elsif what.kind_of?(Array)
126
+ definition ||= proc { topic.send(*what) }
127
+ description = "#{scope} ##{what.shift} with argument(s): #{what}"
125
128
  else
126
129
  description = "#{scope} #{what}"
127
130
  end
@@ -62,11 +62,27 @@ module Riot
62
62
  format = []
63
63
  format << " #{e.class.name} occurred"
64
64
  format << "#{e.to_s}"
65
- e.backtrace.each { |line| format << " at #{line}" }
65
+ filter_backtrace(e.backtrace) { |line| format << " at #{line}" }
66
66
 
67
67
  format.join("\n")
68
68
  end
69
69
 
70
+ protected
71
+ def filter_backtrace(backtrace)
72
+ cleansed = []
73
+ bad = true
74
+
75
+ # goal is to filter all the riot stuff/rake before the first non riot thing
76
+ backtrace.reverse_each do |bt|
77
+ # make sure we are still in the bad part
78
+ bad = (bt =~ /\/lib\/riot/ || bt =~ /rake_test_loader/) if bad
79
+
80
+ yield bt unless bad
81
+ end
82
+
83
+ cleansed.empty?? backtrace : cleansed
84
+ end
85
+
70
86
  begin
71
87
  raise LoadError if ENV["TM_MODE"]
72
88
  require 'rubygems'
@@ -1,148 +1,146 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{riot}
8
- s.version = "0.12.0"
8
+ s.version = "0.12.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin 'Gus' Knowlden"]
12
- s.date = %q{2010-10-19}
12
+ s.date = %q{2011-01-14}
13
13
  s.description = %q{An extremely fast, expressive, and context-driven unit-testing framework. A replacement for all other testing frameworks. Protest the slow test.}
14
14
  s.email = %q{gus@gusg.us}
15
15
  s.extra_rdoc_files = [
16
16
  "README.markdown"
17
17
  ]
18
18
  s.files = [
19
- ".gitignore",
20
- "CHANGELOG",
21
- "MIT-LICENSE",
22
- "README.markdown",
23
- "Rakefile",
24
- "TODO.markdown",
25
- "VERSION",
26
- "lib/riot.rb",
27
- "lib/riot/assertion.rb",
28
- "lib/riot/assertion_macro.rb",
29
- "lib/riot/assertion_macros/any.rb",
30
- "lib/riot/assertion_macros/assigns.rb",
31
- "lib/riot/assertion_macros/empty.rb",
32
- "lib/riot/assertion_macros/equals.rb",
33
- "lib/riot/assertion_macros/equivalent_to.rb",
34
- "lib/riot/assertion_macros/exists.rb",
35
- "lib/riot/assertion_macros/includes.rb",
36
- "lib/riot/assertion_macros/kind_of.rb",
37
- "lib/riot/assertion_macros/matches.rb",
38
- "lib/riot/assertion_macros/nil.rb",
39
- "lib/riot/assertion_macros/not_borat.rb",
40
- "lib/riot/assertion_macros/raises.rb",
41
- "lib/riot/assertion_macros/respond_to.rb",
42
- "lib/riot/assertion_macros/same_elements.rb",
43
- "lib/riot/assertion_macros/size.rb",
44
- "lib/riot/context.rb",
45
- "lib/riot/context_helpers.rb",
46
- "lib/riot/context_options.rb",
47
- "lib/riot/message.rb",
48
- "lib/riot/middleware.rb",
49
- "lib/riot/reporter.rb",
50
- "lib/riot/rr.rb",
51
- "lib/riot/runnable.rb",
52
- "lib/riot/situation.rb",
53
- "riot.gemspec",
54
- "test.watchr",
55
- "test/benchmark/colorize.rb",
56
- "test/benchmark/message_concatenation.rb",
57
- "test/benchmark/riot_vs_minitest.rb",
58
- "test/benchmark/same_elements_vs_set.rb",
59
- "test/benchmark/simple_context_and_assertions.rb",
60
- "test/core/assertion_macros/any_test.rb",
61
- "test/core/assertion_macros/assigns_test.rb",
62
- "test/core/assertion_macros/empty_test.rb",
63
- "test/core/assertion_macros/equals_test.rb",
64
- "test/core/assertion_macros/equivalent_to_test.rb",
65
- "test/core/assertion_macros/exists_test.rb",
66
- "test/core/assertion_macros/includes_test.rb",
67
- "test/core/assertion_macros/kind_of_test.rb",
68
- "test/core/assertion_macros/matches_test.rb",
69
- "test/core/assertion_macros/nil_test.rb",
70
- "test/core/assertion_macros/not_borat_test.rb",
71
- "test/core/assertion_macros/raises_test.rb",
72
- "test/core/assertion_macros/respond_to_test.rb",
73
- "test/core/assertion_macros/same_elements_test.rb",
74
- "test/core/assertion_macros/size_test.rb",
75
- "test/core/context/asserts_topic_test.rb",
76
- "test/core/context/context_test.rb",
77
- "test/core/context/context_with_options_test.rb",
78
- "test/core/context/deny_test.rb",
79
- "test/core/context/helper_test.rb",
80
- "test/core/context/hookup_test.rb",
81
- "test/core/context/nested_contexts_test.rb",
82
- "test/core/context/premium_setup_test.rb",
83
- "test/core/context/should_test.rb",
84
- "test/core/context/using_describe_in_a_test.rb",
85
- "test/core/middleware/chained_context_middleware_test.rb",
86
- "test/core/middleware/context_middleware_test.rb",
87
- "test/core/report_test.rb",
88
- "test/core/runnable/assertion_macro_test.rb",
89
- "test/core/runnable/assertion_test.rb",
90
- "test/core/runnable/message_test.rb",
91
- "test/core/runnable/negative_assertion_test.rb",
92
- "test/core/runnable/setup_test.rb",
93
- "test/core/runnable/situation_test.rb",
94
- "test/core/runnable/teardown_test.rb",
95
- "test/extensions/rrriot_test.rb",
96
- "test/teststrap.rb"
19
+ "CHANGELOG",
20
+ "MIT-LICENSE",
21
+ "README.markdown",
22
+ "Rakefile",
23
+ "TODO.markdown",
24
+ "VERSION",
25
+ "lib/riot.rb",
26
+ "lib/riot/assertion.rb",
27
+ "lib/riot/assertion_macro.rb",
28
+ "lib/riot/assertion_macros/any.rb",
29
+ "lib/riot/assertion_macros/assigns.rb",
30
+ "lib/riot/assertion_macros/empty.rb",
31
+ "lib/riot/assertion_macros/equals.rb",
32
+ "lib/riot/assertion_macros/equivalent_to.rb",
33
+ "lib/riot/assertion_macros/exists.rb",
34
+ "lib/riot/assertion_macros/includes.rb",
35
+ "lib/riot/assertion_macros/kind_of.rb",
36
+ "lib/riot/assertion_macros/matches.rb",
37
+ "lib/riot/assertion_macros/nil.rb",
38
+ "lib/riot/assertion_macros/not_borat.rb",
39
+ "lib/riot/assertion_macros/raises.rb",
40
+ "lib/riot/assertion_macros/respond_to.rb",
41
+ "lib/riot/assertion_macros/same_elements.rb",
42
+ "lib/riot/assertion_macros/size.rb",
43
+ "lib/riot/context.rb",
44
+ "lib/riot/context_helpers.rb",
45
+ "lib/riot/context_options.rb",
46
+ "lib/riot/message.rb",
47
+ "lib/riot/middleware.rb",
48
+ "lib/riot/reporter.rb",
49
+ "lib/riot/rr.rb",
50
+ "lib/riot/runnable.rb",
51
+ "lib/riot/situation.rb",
52
+ "riot.gemspec",
53
+ "test.watchr",
54
+ "test/benchmark/colorize.rb",
55
+ "test/benchmark/message_concatenation.rb",
56
+ "test/benchmark/riot_vs_minitest.rb",
57
+ "test/benchmark/same_elements_vs_set.rb",
58
+ "test/benchmark/simple_context_and_assertions.rb",
59
+ "test/core/assertion_macros/any_test.rb",
60
+ "test/core/assertion_macros/assigns_test.rb",
61
+ "test/core/assertion_macros/empty_test.rb",
62
+ "test/core/assertion_macros/equals_test.rb",
63
+ "test/core/assertion_macros/equivalent_to_test.rb",
64
+ "test/core/assertion_macros/exists_test.rb",
65
+ "test/core/assertion_macros/includes_test.rb",
66
+ "test/core/assertion_macros/kind_of_test.rb",
67
+ "test/core/assertion_macros/matches_test.rb",
68
+ "test/core/assertion_macros/nil_test.rb",
69
+ "test/core/assertion_macros/not_borat_test.rb",
70
+ "test/core/assertion_macros/raises_test.rb",
71
+ "test/core/assertion_macros/respond_to_test.rb",
72
+ "test/core/assertion_macros/same_elements_test.rb",
73
+ "test/core/assertion_macros/size_test.rb",
74
+ "test/core/context/asserts_topic_test.rb",
75
+ "test/core/context/context_test.rb",
76
+ "test/core/context/context_with_options_test.rb",
77
+ "test/core/context/deny_test.rb",
78
+ "test/core/context/helper_test.rb",
79
+ "test/core/context/hookup_test.rb",
80
+ "test/core/context/nested_contexts_test.rb",
81
+ "test/core/context/premium_setup_test.rb",
82
+ "test/core/context/should_test.rb",
83
+ "test/core/context/using_describe_in_a_test.rb",
84
+ "test/core/middleware/chained_context_middleware_test.rb",
85
+ "test/core/middleware/context_middleware_test.rb",
86
+ "test/core/report_test.rb",
87
+ "test/core/runnable/assertion_macro_test.rb",
88
+ "test/core/runnable/assertion_test.rb",
89
+ "test/core/runnable/message_test.rb",
90
+ "test/core/runnable/negative_assertion_test.rb",
91
+ "test/core/runnable/setup_test.rb",
92
+ "test/core/runnable/situation_test.rb",
93
+ "test/core/runnable/teardown_test.rb",
94
+ "test/extensions/rrriot_test.rb",
95
+ "test/teststrap.rb"
97
96
  ]
98
97
  s.homepage = %q{http://github.com/thumblemonks/riot}
99
- s.rdoc_options = ["--charset=UTF-8"]
100
98
  s.require_paths = ["lib"]
101
99
  s.rubygems_version = %q{1.3.6}
102
100
  s.summary = %q{An extremely fast, expressive, and context-driven unit-testing framework. Protest the slow test.}
103
101
  s.test_files = [
104
102
  "test/benchmark/colorize.rb",
105
- "test/benchmark/message_concatenation.rb",
106
- "test/benchmark/riot_vs_minitest.rb",
107
- "test/benchmark/same_elements_vs_set.rb",
108
- "test/benchmark/simple_context_and_assertions.rb",
109
- "test/core/assertion_macros/any_test.rb",
110
- "test/core/assertion_macros/assigns_test.rb",
111
- "test/core/assertion_macros/empty_test.rb",
112
- "test/core/assertion_macros/equals_test.rb",
113
- "test/core/assertion_macros/equivalent_to_test.rb",
114
- "test/core/assertion_macros/exists_test.rb",
115
- "test/core/assertion_macros/includes_test.rb",
116
- "test/core/assertion_macros/kind_of_test.rb",
117
- "test/core/assertion_macros/matches_test.rb",
118
- "test/core/assertion_macros/nil_test.rb",
119
- "test/core/assertion_macros/not_borat_test.rb",
120
- "test/core/assertion_macros/raises_test.rb",
121
- "test/core/assertion_macros/respond_to_test.rb",
122
- "test/core/assertion_macros/same_elements_test.rb",
123
- "test/core/assertion_macros/size_test.rb",
124
- "test/core/context/asserts_topic_test.rb",
125
- "test/core/context/context_test.rb",
126
- "test/core/context/context_with_options_test.rb",
127
- "test/core/context/deny_test.rb",
128
- "test/core/context/helper_test.rb",
129
- "test/core/context/hookup_test.rb",
130
- "test/core/context/nested_contexts_test.rb",
131
- "test/core/context/premium_setup_test.rb",
132
- "test/core/context/should_test.rb",
133
- "test/core/context/using_describe_in_a_test.rb",
134
- "test/core/middleware/chained_context_middleware_test.rb",
135
- "test/core/middleware/context_middleware_test.rb",
136
- "test/core/report_test.rb",
137
- "test/core/runnable/assertion_macro_test.rb",
138
- "test/core/runnable/assertion_test.rb",
139
- "test/core/runnable/message_test.rb",
140
- "test/core/runnable/negative_assertion_test.rb",
141
- "test/core/runnable/setup_test.rb",
142
- "test/core/runnable/situation_test.rb",
143
- "test/core/runnable/teardown_test.rb",
144
- "test/extensions/rrriot_test.rb",
145
- "test/teststrap.rb"
103
+ "test/benchmark/message_concatenation.rb",
104
+ "test/benchmark/riot_vs_minitest.rb",
105
+ "test/benchmark/same_elements_vs_set.rb",
106
+ "test/benchmark/simple_context_and_assertions.rb",
107
+ "test/core/assertion_macros/any_test.rb",
108
+ "test/core/assertion_macros/assigns_test.rb",
109
+ "test/core/assertion_macros/empty_test.rb",
110
+ "test/core/assertion_macros/equals_test.rb",
111
+ "test/core/assertion_macros/equivalent_to_test.rb",
112
+ "test/core/assertion_macros/exists_test.rb",
113
+ "test/core/assertion_macros/includes_test.rb",
114
+ "test/core/assertion_macros/kind_of_test.rb",
115
+ "test/core/assertion_macros/matches_test.rb",
116
+ "test/core/assertion_macros/nil_test.rb",
117
+ "test/core/assertion_macros/not_borat_test.rb",
118
+ "test/core/assertion_macros/raises_test.rb",
119
+ "test/core/assertion_macros/respond_to_test.rb",
120
+ "test/core/assertion_macros/same_elements_test.rb",
121
+ "test/core/assertion_macros/size_test.rb",
122
+ "test/core/context/asserts_topic_test.rb",
123
+ "test/core/context/context_test.rb",
124
+ "test/core/context/context_with_options_test.rb",
125
+ "test/core/context/deny_test.rb",
126
+ "test/core/context/helper_test.rb",
127
+ "test/core/context/hookup_test.rb",
128
+ "test/core/context/nested_contexts_test.rb",
129
+ "test/core/context/premium_setup_test.rb",
130
+ "test/core/context/should_test.rb",
131
+ "test/core/context/using_describe_in_a_test.rb",
132
+ "test/core/middleware/chained_context_middleware_test.rb",
133
+ "test/core/middleware/context_middleware_test.rb",
134
+ "test/core/report_test.rb",
135
+ "test/core/runnable/assertion_macro_test.rb",
136
+ "test/core/runnable/assertion_test.rb",
137
+ "test/core/runnable/message_test.rb",
138
+ "test/core/runnable/negative_assertion_test.rb",
139
+ "test/core/runnable/setup_test.rb",
140
+ "test/core/runnable/situation_test.rb",
141
+ "test/core/runnable/teardown_test.rb",
142
+ "test/extensions/rrriot_test.rb",
143
+ "test/teststrap.rb"
146
144
  ]
147
145
 
148
146
  if s.respond_to? :specification_version then
@@ -148,6 +148,7 @@ context "DotMatrixReporter" do
148
148
  asserts_topic('puts an E').matches('E')
149
149
  asserts_topic('puts the full context + assertion name').matches('whatever asserts bang')
150
150
  asserts_topic('puts the exception message').matches('BOOM')
151
- asserts_topic('puts the exception backtrace').matches(__FILE__)
151
+ # <file path>:<one or more number><two newlines><anything till end of line><newline> is the last thing in the stack trace
152
+ asserts_topic('puts the filtered exception backtrace').matches(/#{__FILE__}:\d+\n\n.*$\n\z/)
152
153
  end
153
154
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 12
8
- - 0
9
- version: 0.12.0
8
+ - 1
9
+ version: 0.12.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Justin 'Gus' Knowlden
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-19 00:00:00 -05:00
17
+ date: 2011-01-14 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -50,7 +50,6 @@ extensions: []
50
50
  extra_rdoc_files:
51
51
  - README.markdown
52
52
  files:
53
- - .gitignore
54
53
  - CHANGELOG
55
54
  - MIT-LICENSE
56
55
  - README.markdown
@@ -133,8 +132,8 @@ homepage: http://github.com/thumblemonks/riot
133
132
  licenses: []
134
133
 
135
134
  post_install_message:
136
- rdoc_options:
137
- - --charset=UTF-8
135
+ rdoc_options: []
136
+
138
137
  require_paths:
139
138
  - lib
140
139
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- *.gem
2
- pkg
3
- .*.swp
4
- doc
5
- .yardoc
6
- *.tmproj
7
- _site