wrong 0.4.5-java → 0.5.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +9 -8
- data/lib/wrong.rb +1 -1
- data/lib/wrong/adapters/rspec.rb +10 -1
- data/lib/wrong/chunk.rb +74 -9
- data/lib/wrong/version.rb +1 -1
- data/test/adapters/rspec1/failing_spec.rb +9 -0
- data/test/adapters/rspec2/failing_spec.rb +9 -0
- data/test/adapters/rspec_test.rb +1 -1
- data/test/chunk_test.rb +90 -8
- data/test/d_test.rb +3 -1
- data/test/failure_message_test.rb +1 -1
- metadata +200 -150
data/README.markdown
CHANGED
@@ -159,7 +159,7 @@ Here's an RSpec example:
|
|
159
159
|
|
160
160
|
describe BleuCheese do
|
161
161
|
it "stinks" do
|
162
|
-
|
162
|
+
expect { BleuCheese.new.smell > 9000 }
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
@@ -171,11 +171,11 @@ This makes your code read like a BDD-style DSL, without RSpec's arcane "should"
|
|
171
171
|
|
172
172
|
BleuCheese.new.smell.should > 9000
|
173
173
|
|
174
|
-
and seriously, tell me which one more clearly describes the desired behavior. The object under test doesn't really have a `should` method, so why should it during a test? And in what human language is "should greater than" a valid phrase?
|
174
|
+
and seriously, tell me which one more clearly describes the desired behavior. The object under test doesn't really have a `should` method, so why should it magically get one during a test? And in what human language is "should greater than" a valid phrase?
|
175
175
|
|
176
176
|
## Algorithm ##
|
177
177
|
|
178
|
-
So wait a second. How do we do it? Doesn't Ruby have [poor support for AST introspection](http://blog.zenspider.com/2009/04/parsetree-eol.html)? Well, yes, it does, so we cheat: we figure out what file and line the assert block is defined in, then open the file, read the code, and parse it directly using Ryan Davis' amazing [RubyParser](http://parsetree.rubyforge.org/ruby_parser/) and [Ruby2Ruby](http://seattlerb.rubyforge.org/ruby2ruby/). You can bask in the kludge by examining `chunk.rb` and `assert.rb`. If you find some code it can't parse, please send it our way.
|
178
|
+
So wait a second. How do we do it? Doesn't Ruby have [poor support for AST introspection](http://blog.zenspider.com/2009/04/parsetree-eol.html)? Well, yes, it does, so we cheat: we figure out what file and line the assert block is defined in, then open the file, read the code, and parse it directly using Ryan Davis' amazing [RubyParser](http://parsetree.rubyforge.org/ruby_parser/) and [Ruby2Ruby](http://seattlerb.rubyforge.org/ruby2ruby/). You can bask in the kludge by examining `chunk.rb` and `assert.rb`. If you find some code it can't parse, please send it our way. As a failsafe we also use Sourcify, which has yet another home baked RACC parser, so we have many chances to parse your code.
|
179
179
|
|
180
180
|
Before you get your knickers in a twist about how this is totally unacceptable because it doesn't support this or that use case, here are our caveats and excuses:
|
181
181
|
|
@@ -183,7 +183,7 @@ Before you get your knickers in a twist about how this is totally unacceptable b
|
|
183
183
|
* Your code needs to be in a file.
|
184
184
|
* If you're developing Ruby code without saving it to a mounted disk, then sorry, Wrong is not right for you.
|
185
185
|
* We monkey-patch IRB so if you do `irb -rwrong` it'll save off your session in memory where Wrong can read it.
|
186
|
-
* It'd be nice if it could work inside a `-e` block but as far as we can tell, there's no way to grab that `-e` code from inside Ruby.
|
186
|
+
* It'd be nice if it could work inside a `-e` block but as far as we can tell, there's no way to grab that `-e` source code from inside Ruby.
|
187
187
|
* It's a development-time testing library, not a production runtime library, so there are no security or filesystem issues.
|
188
188
|
* `eval` isn't evil, it's just misunderstood.
|
189
189
|
* It makes a few assumptions about the structure of your code, leading to some restrictions:
|
@@ -191,6 +191,7 @@ Before you get your knickers in a twist about how this is totally unacceptable b
|
|
191
191
|
* You can't use metaprogramming to write your assert blocks.
|
192
192
|
* All variables and methods must be available in the binding of the assert block.
|
193
193
|
* Passing a proc around and eventually calling assert on it might not work in some Ruby implementations.
|
194
|
+
* "Doesn't all this parsing slow down my test run"? No - this applies to failure cases only. If the assert block returns true then Wrong simply moves on.
|
194
195
|
|
195
196
|
## Adapters ##
|
196
197
|
|
@@ -210,7 +211,7 @@ To use these, put the appropriate `require` in your helper, **after** requiring
|
|
210
211
|
|
211
212
|
assert("since we're on Earth") { sky.blue? }
|
212
213
|
|
213
|
-
Since the point of Wrong is to make asserts self-explanatory, you should
|
214
|
+
Since the point of Wrong is to make asserts self-explanatory, you should use explanations only when they would add something that you couldn't get from reading the (failed) assertion code itself. Don't bother doing things like this:
|
214
215
|
|
215
216
|
assert("the sky should be blue") { sky.blue? } # redundant
|
216
217
|
|
@@ -231,13 +232,13 @@ When a failure occurs, the exception message contains all the details you might
|
|
231
232
|
* If there is a formatter registered for this type of predicate, its output will come next. (See below.)
|
232
233
|
* SUBEXP is each of the subtrees of the claim, minus duplicates and truisms (e.g. literals).
|
233
234
|
* The word "is" is a very nice separator since it doesn't look like code, but is short enough to be easily visually parsed.
|
234
|
-
* VALUE is `eval(SUBEXP).inspect
|
235
|
+
* VALUE is `eval(SUBEXP).inspect`, wrapped and indented if necessary to fit your console
|
235
236
|
|
236
237
|
We hope this structure lets your eyes focus on the meaningful values and differences in the message, rather than glossing over with stack-trace burnout. If you have any suggestions on how to improve it, please share them.
|
237
238
|
|
238
239
|
(Why does VALUE use `inspect` and not `to_s`? Because `inspect` on standard objects like String and Array are sure to show all relevant details, such as white space, in a console-safe way, and we hope other libraries follow suit. Also, `to_s` often inserts line breaks and that messes up formatting and legibility.)
|
239
240
|
|
240
|
-
Wrong tries to maintain indentation to improve readability. If the inspected VALUE contains newlines, the succeeding lines will be indented to
|
241
|
+
Wrong tries to maintain indentation to improve readability. If the inspected VALUE contains newlines, or is longer than will fit on your console, the succeeding lines will be indented to a pleasant level.
|
241
242
|
|
242
243
|
## Formatters ##
|
243
244
|
|
@@ -288,7 +289,7 @@ or any of these at runtime:
|
|
288
289
|
|
289
290
|
### Color ###
|
290
291
|
|
291
|
-
Apparently, no test framework is successful unless and until it supports console colors.
|
292
|
+
Apparently, no test framework is successful unless and until it supports console colors. Call
|
292
293
|
|
293
294
|
Wrong.config.color
|
294
295
|
|
data/lib/wrong.rb
CHANGED
data/lib/wrong/adapters/rspec.rb
CHANGED
@@ -15,11 +15,20 @@ if Object.const_defined? :RSpec
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
# This would work if we didn't need to define failure_class
|
19
|
+
# todo: figure out how to get RSpec's config object to class_eval or whatever
|
20
|
+
# Rspec.configure do |config|
|
21
|
+
# config.include Wrong
|
22
|
+
# def failure_class
|
23
|
+
# RSpec::Expectations::ExpectationNotMetError
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
|
18
27
|
module RSpec
|
19
28
|
module Core
|
20
29
|
class ExampleGroup
|
21
30
|
include Wrong
|
22
|
-
|
31
|
+
|
23
32
|
def failure_class
|
24
33
|
RSpec::Expectations::ExpectationNotMetError
|
25
34
|
end
|
data/lib/wrong/chunk.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'ruby_parser'
|
2
2
|
require 'ruby2ruby'
|
3
|
+
require 'pp'
|
3
4
|
|
4
5
|
def require_optionally(library)
|
5
6
|
begin
|
@@ -63,8 +64,8 @@ module Wrong
|
|
63
64
|
# first try sourcify
|
64
65
|
@block.to_sexp[3] # the [3] is to strip out the "proc {" sourcify adds to everything
|
65
66
|
end
|
66
|
-
rescue
|
67
|
-
# fall through
|
67
|
+
rescue Exception => e
|
68
|
+
# sourcify failed, so fall through
|
68
69
|
end
|
69
70
|
|
70
71
|
# next try glomming
|
@@ -136,8 +137,8 @@ module Wrong
|
|
136
137
|
self.claim.to_ruby
|
137
138
|
rescue => e
|
138
139
|
# note: this is untested; it's to recover from when we can't locate the code
|
139
|
-
message = "Failed
|
140
|
-
raise
|
140
|
+
message = "Failed at #{file}:#{line_number} [couldn't retrieve source code due to #{e.inspect}]"
|
141
|
+
raise message
|
141
142
|
end
|
142
143
|
|
143
144
|
def parts(sexp = nil)
|
@@ -173,9 +174,25 @@ module Wrong
|
|
173
174
|
def details
|
174
175
|
@details ||= build_details
|
175
176
|
end
|
177
|
+
|
178
|
+
def pretty_value(value, starting_col = 0, indent_wrapped_lines = 6, width = Chunk.terminal_width)
|
179
|
+
# inspected = value.inspect
|
180
|
+
|
181
|
+
# note that if the first line overflows due to the starting column then pp won't wrap it right
|
182
|
+
inspected = PP.pp(value, "", width - starting_col).chomp
|
183
|
+
|
184
|
+
# this bit might be redundant with the pp call now
|
185
|
+
indented = indent_all(6, inspected)
|
186
|
+
if width
|
187
|
+
wrap_and_indent(indented, starting_col, indent_wrapped_lines, width)
|
188
|
+
else
|
189
|
+
indented
|
190
|
+
end
|
191
|
+
end
|
176
192
|
|
177
193
|
private
|
178
194
|
|
195
|
+
# todo: move to FailureMessage?
|
179
196
|
def build_details
|
180
197
|
require "wrong/rainbow" if Wrong.config[:color]
|
181
198
|
s = ""
|
@@ -193,12 +210,12 @@ module Wrong
|
|
193
210
|
part.gsub!(/\n/, newline(2))
|
194
211
|
part += newline(3)
|
195
212
|
end
|
196
|
-
value =
|
213
|
+
value = pretty_value(value, (4 + part.length + 4))
|
197
214
|
if Wrong.config[:color]
|
198
215
|
part = part.color(:blue)
|
199
216
|
value = value.color(:magenta)
|
200
217
|
end
|
201
|
-
details << indent(
|
218
|
+
details << indent(4, part, " is ", value)
|
202
219
|
end
|
203
220
|
rescue Exception => e
|
204
221
|
raises = "raises #{e.class}"
|
@@ -207,9 +224,9 @@ module Wrong
|
|
207
224
|
raises = raises.bold.color(:red)
|
208
225
|
end
|
209
226
|
formatted_exeption = if e.message and e.message != e.class.to_s
|
210
|
-
indent(
|
227
|
+
indent(4, part, " ", raises, ": ", indent_all(6, e.message))
|
211
228
|
else
|
212
|
-
indent(
|
229
|
+
indent(4, part, " ", raises)
|
213
230
|
end
|
214
231
|
details << formatted_exeption
|
215
232
|
end
|
@@ -227,7 +244,7 @@ module Wrong
|
|
227
244
|
|
228
245
|
public # don't know exactly why this needs to be public but eval'ed code can't find it otherwise
|
229
246
|
def indent(indent, *s)
|
230
|
-
"#{"
|
247
|
+
"#{" " * indent}#{s.join('')}"
|
231
248
|
end
|
232
249
|
|
233
250
|
def newline(indent)
|
@@ -237,6 +254,54 @@ public # don't know exactly why this needs to be public but eval'ed code can't f
|
|
237
254
|
def indent_all(amount, s)
|
238
255
|
s.gsub("\n", "\n#{indent(amount)}")
|
239
256
|
end
|
257
|
+
|
258
|
+
def wrap_and_indent(indented, starting_col, indent_wrapped_lines, full_width)
|
259
|
+
first_line = true
|
260
|
+
width = full_width - starting_col # the first line is essentially shorter
|
261
|
+
indented.split("\n").map do |line|
|
262
|
+
s = ""
|
263
|
+
while line.length > width
|
264
|
+
s << line[0...width]
|
265
|
+
s << newline(indent_wrapped_lines)
|
266
|
+
line = line[width..-1]
|
267
|
+
if first_line
|
268
|
+
width += starting_col - indent_wrapped_lines
|
269
|
+
first_line = false
|
270
|
+
end
|
271
|
+
end
|
272
|
+
s << line
|
273
|
+
s
|
274
|
+
end.join("\n")
|
275
|
+
end
|
276
|
+
|
277
|
+
# Returns [width, height] of terminal when detected, nil if not detected.
|
278
|
+
# Think of this as a simpler version of Highline's Highline::SystemExtensions.terminal_size()
|
279
|
+
# Lifted from https://github.com/cldwalker/hirb/blob/master/lib/hirb/util.rb#L59
|
280
|
+
def self.terminal_size
|
281
|
+
@@terminal_size ||= begin
|
282
|
+
if (ENV['COLUMNS'] =~ /^\d+$/) && (ENV['LINES'] =~ /^\d+$/)
|
283
|
+
[ENV['COLUMNS'].to_i, ENV['LINES'].to_i]
|
284
|
+
elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')
|
285
|
+
[`tput cols`.to_i, `tput lines`.to_i]
|
286
|
+
elsif STDIN.tty? && command_exists?('stty')
|
287
|
+
`stty size`.scan(/\d+/).map { |s| s.to_i }.reverse
|
288
|
+
else
|
289
|
+
nil
|
290
|
+
end
|
291
|
+
rescue
|
292
|
+
nil
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
def self.terminal_width
|
297
|
+
terminal_size && terminal_size.first
|
298
|
+
end
|
299
|
+
|
300
|
+
# Determines if a shell command exists by searching for it in ENV['PATH'].
|
301
|
+
def self.command_exists?(command)
|
302
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).any? {|d| File.exists? File.join(d, command) }
|
303
|
+
end
|
304
|
+
|
240
305
|
|
241
306
|
end
|
242
307
|
|
data/lib/wrong/version.rb
CHANGED
@@ -13,6 +13,15 @@ require "wrong/adapters/rspec"
|
|
13
13
|
# since we're not running 'spec' we have to do some stuff ourselves
|
14
14
|
include Spec::DSL::Main
|
15
15
|
|
16
|
+
describe "wrong's failure" do
|
17
|
+
it "is an RSpec exception" do
|
18
|
+
e = rescuing {
|
19
|
+
assert { false }
|
20
|
+
}
|
21
|
+
e.should be_a(Spec::Expectations::ExpectationNotMetError)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
16
25
|
describe "arithmetic" do
|
17
26
|
it "should not work like this" do
|
18
27
|
assert { 2 + 2 == 5 }
|
@@ -17,6 +17,15 @@ puts RSpec::Core::Version::STRING
|
|
17
17
|
require 'rspec/autorun'
|
18
18
|
require "wrong/adapters/rspec"
|
19
19
|
|
20
|
+
describe "wrong's failure" do
|
21
|
+
it "is an RSpec exception" do
|
22
|
+
e = rescuing {
|
23
|
+
assert { false }
|
24
|
+
}
|
25
|
+
e.should be_a(RSpec::Expectations::ExpectationNotMetError)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
20
29
|
describe "arithmetic" do
|
21
30
|
it "should not work like this" do
|
22
31
|
assert { 2 + 2 == 5 }
|
data/test/adapters/rspec_test.rb
CHANGED
@@ -36,7 +36,7 @@ describe "testing rspec" do
|
|
36
36
|
(rspec_version == 1 || RUBY_VERSION =~ /^1\.8\./ || RUBY_VERSION == '1.9.1' ? nil : 1) # RSpec v1 exits with 0 on failure :-(
|
37
37
|
end
|
38
38
|
|
39
|
-
assert { spec_output.include? "
|
39
|
+
assert { spec_output.include? "2 examples, 1 failure" }
|
40
40
|
assert { spec_output.include? "Expected ((2 + 2) == 5), but" }
|
41
41
|
end
|
42
42
|
end
|
data/test/chunk_test.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
1
|
+
here = File.expand_path(File.dirname(__FILE__))
|
2
|
+
require "#{here}/test_helper"
|
2
3
|
require "wrong/chunk"
|
4
|
+
require 'yaml'
|
3
5
|
|
4
6
|
unless Object.const_defined?(:Chunk)
|
5
7
|
Chunk = Wrong::Chunk
|
@@ -74,7 +76,7 @@ describe Chunk do
|
|
74
76
|
end
|
75
77
|
|
76
78
|
it "finds the file to parse even when inside a chdir to a child directory" do
|
77
|
-
Dir.chdir("
|
79
|
+
Dir.chdir("#{here}") do
|
78
80
|
chunk = Chunk.new __FILE__, __LINE__ + 1; <<-CODE
|
79
81
|
"hi"
|
80
82
|
CODE
|
@@ -255,6 +257,15 @@ z
|
|
255
257
|
assert d == "\n" + ' x is "flavor:\tvanilla"' + "\n"
|
256
258
|
end
|
257
259
|
|
260
|
+
it "splits lower-down details correctly (bug)" do
|
261
|
+
hash = {:flavor => "vanilla"}
|
262
|
+
exception_with_newlines = Exception.new(hash.to_yaml.chomp)
|
263
|
+
d = details {
|
264
|
+
rescuing { raise exception_with_newlines }.message.include?(":flavor: chocolate")
|
265
|
+
}
|
266
|
+
assert d.include? "exception_with_newlines is #<Exception: --- \n :flavor: vanilla>"
|
267
|
+
end
|
268
|
+
|
258
269
|
it "skips assignments" do
|
259
270
|
y = 14
|
260
271
|
d = details { x = 7; y }
|
@@ -262,17 +273,88 @@ z
|
|
262
273
|
assert d =~ /y is 14/
|
263
274
|
end
|
264
275
|
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
276
|
+
class Weirdo
|
277
|
+
def initialize(inspected_value)
|
278
|
+
@inspected_value = inspected_value
|
279
|
+
end
|
280
|
+
|
281
|
+
def inspect
|
282
|
+
@inspected_value
|
270
283
|
end
|
284
|
+
end
|
285
|
+
|
271
286
|
|
272
|
-
|
287
|
+
it "indents unescaped newlines inside the inspected value" do
|
288
|
+
x = Weirdo.new("first\nsecond\nthird")
|
273
289
|
d = details { assert { x == "foo" } }
|
274
290
|
assert d == "\n x is first\n second\n third\n"
|
275
291
|
end
|
292
|
+
|
293
|
+
describe '#pretty_value' do
|
294
|
+
before do
|
295
|
+
@chunk = chunk = Chunk.new(__FILE__, __LINE__ + 1); <<-CODE
|
296
|
+
true
|
297
|
+
CODE
|
298
|
+
end
|
299
|
+
|
300
|
+
it 'inspects its value' do
|
301
|
+
assert @chunk.pretty_value(12) == "12"
|
302
|
+
assert @chunk.pretty_value("foo") == "\"foo\""
|
303
|
+
end
|
304
|
+
|
305
|
+
it 'escapes newlines in strings' do
|
306
|
+
assert @chunk.pretty_value("foo\nbar\nbaz") == "\"foo\\nbar\\nbaz\""
|
307
|
+
end
|
308
|
+
|
309
|
+
it 'indents newlines in raw inspect values (e.g. exceptions or YAML or whatever)' do
|
310
|
+
w = Weirdo.new("foo\nbar\nbaz")
|
311
|
+
assert @chunk.pretty_value(w) == "foo\n bar\n baz"
|
312
|
+
end
|
313
|
+
|
314
|
+
# def pretty_value(value, starting_col = 0, indent_wrapped_lines = 3, size = Chunk.terminal_size)
|
315
|
+
|
316
|
+
it 'inserts newlines in really long values, wrapped at the terminal width' do
|
317
|
+
abc = Weirdo.new("abcdefghijklmnopqrstuvwxyz")
|
318
|
+
pretty = @chunk.pretty_value(abc, 0, 0, 10)
|
319
|
+
assert pretty == <<-DONE.chomp
|
320
|
+
abcdefghij
|
321
|
+
klmnopqrst
|
322
|
+
uvwxyz
|
323
|
+
DONE
|
324
|
+
end
|
325
|
+
|
326
|
+
it 'subtracts the starting column from the wrapped width of the first line' do
|
327
|
+
abc = Weirdo.new("abcdefghijklmnopqrstuvwxyz")
|
328
|
+
pretty = @chunk.pretty_value(abc, 2, 0, 10)
|
329
|
+
assert pretty == <<-DONE.chomp
|
330
|
+
abcdefgh
|
331
|
+
ijklmnopqr
|
332
|
+
stuvwxyz
|
333
|
+
DONE
|
334
|
+
end
|
335
|
+
|
336
|
+
it "indents wrapped lines" do
|
337
|
+
abc = Weirdo.new("abcdefghijklmnopqrstuvwxyz")
|
338
|
+
pretty = @chunk.pretty_value(abc, 2, 3, 10)
|
339
|
+
assert pretty == <<-DONE.chomp
|
340
|
+
abcdefgh
|
341
|
+
ijklmno
|
342
|
+
pqrstuv
|
343
|
+
wxyz
|
344
|
+
DONE
|
345
|
+
end
|
346
|
+
|
347
|
+
it "wraps correctly" do
|
348
|
+
hash = {:flavor => "vanilla"}
|
349
|
+
object = Weirdo.new(hash.to_yaml.chomp)
|
350
|
+
pretty = @chunk.pretty_value(object, 2, 3, 80)
|
351
|
+
assert pretty == <<-DONE.chomp
|
352
|
+
---
|
353
|
+
:flavor: vanilla
|
354
|
+
DONE
|
355
|
+
end
|
356
|
+
|
357
|
+
end
|
276
358
|
|
277
359
|
end
|
278
360
|
end
|
data/test/d_test.rb
CHANGED
metadata
CHANGED
@@ -3,89 +3,94 @@ name: wrong
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 0.
|
6
|
+
- 0
|
7
|
+
- 5
|
8
|
+
- 0
|
9
|
+
version: 0.5.0
|
10
10
|
platform: java
|
11
11
|
authors:
|
12
|
-
|
13
|
-
|
12
|
+
- Steve Conover
|
13
|
+
- Alex Chaffee
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-08 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: predicated
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 2
|
31
|
+
- 2
|
32
|
+
version: 0.2.2
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: ruby_parser
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 2
|
45
|
+
- 0
|
46
|
+
- 4
|
47
|
+
version: 2.0.4
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: ruby2ruby
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 1
|
60
|
+
- 2
|
61
|
+
version: "1.2"
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: sexp_processor
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ~>
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 3
|
74
|
+
- 0
|
75
|
+
version: "3.0"
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: diff-lcs
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
segments:
|
87
|
+
- 1
|
88
|
+
- 1
|
89
|
+
- 2
|
90
|
+
version: 1.1.2
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: *id005
|
89
94
|
description: |-
|
90
95
|
Wrong provides a general assert method that takes a predicate block. Assertion failure
|
91
96
|
messages are rich in detail. The Wrong idea is to replace all those countless assert_this,
|
@@ -99,28 +104,70 @@ executables: []
|
|
99
104
|
extensions: []
|
100
105
|
|
101
106
|
extra_rdoc_files:
|
102
|
-
|
107
|
+
- README.markdown
|
103
108
|
files:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
109
|
+
- lib/wrong/adapters/minitest.rb
|
110
|
+
- lib/wrong/adapters/rspec.rb
|
111
|
+
- lib/wrong/adapters/test_unit.rb
|
112
|
+
- lib/wrong/assert.rb
|
113
|
+
- lib/wrong/chunk.rb
|
114
|
+
- lib/wrong/close_to.rb
|
115
|
+
- lib/wrong/config.rb
|
116
|
+
- lib/wrong/d.rb
|
117
|
+
- lib/wrong/failure_message.rb
|
118
|
+
- lib/wrong/helpers.rb
|
119
|
+
- lib/wrong/irb.rb
|
120
|
+
- lib/wrong/message/array_diff.rb
|
121
|
+
- lib/wrong/message/string_comparison.rb
|
122
|
+
- lib/wrong/message/test_context.rb
|
123
|
+
- lib/wrong/rainbow.rb
|
124
|
+
- lib/wrong/ruby2ruby_patch.rb
|
125
|
+
- lib/wrong/sexp_ext.rb
|
126
|
+
- lib/wrong/version.rb
|
127
|
+
- lib/wrong.rb
|
128
|
+
- README.markdown
|
129
|
+
- test/adapters/minitest_test.rb
|
130
|
+
- test/adapters/railsapp/app/controllers/application_controller.rb
|
131
|
+
- test/adapters/railsapp/app/helpers/application_helper.rb
|
132
|
+
- test/adapters/railsapp/autotest/discover.rb
|
133
|
+
- test/adapters/railsapp/config/application.rb
|
134
|
+
- test/adapters/railsapp/config/boot.rb
|
135
|
+
- test/adapters/railsapp/config/environment.rb
|
136
|
+
- test/adapters/railsapp/config/environments/development.rb
|
137
|
+
- test/adapters/railsapp/config/environments/production.rb
|
138
|
+
- test/adapters/railsapp/config/environments/test.rb
|
139
|
+
- test/adapters/railsapp/config/initializers/backtrace_silencers.rb
|
140
|
+
- test/adapters/railsapp/config/initializers/inflections.rb
|
141
|
+
- test/adapters/railsapp/config/initializers/mime_types.rb
|
142
|
+
- test/adapters/railsapp/config/initializers/secret_token.rb
|
143
|
+
- test/adapters/railsapp/config/initializers/session_store.rb
|
144
|
+
- test/adapters/railsapp/config/routes.rb
|
145
|
+
- test/adapters/railsapp/db/seeds.rb
|
146
|
+
- test/adapters/railsapp/spec/spec_helper.rb
|
147
|
+
- test/adapters/railsapp/spec/wrong_spec.rb
|
148
|
+
- test/adapters/rspec1/failing_spec.rb
|
149
|
+
- test/adapters/rspec2/failing_spec.rb
|
150
|
+
- test/adapters/rspec_rails_test.rb
|
151
|
+
- test/adapters/rspec_test.rb
|
152
|
+
- test/adapters/test_unit_test.rb
|
153
|
+
- test/assert_advanced_test.rb
|
154
|
+
- test/assert_test.rb
|
155
|
+
- test/capturing_test.rb
|
156
|
+
- test/chunk_test.rb
|
157
|
+
- test/close_to_test.rb
|
158
|
+
- test/config_test.rb
|
159
|
+
- test/d_test.rb
|
160
|
+
- test/failure_message_test.rb
|
161
|
+
- test/failures_test.rb
|
162
|
+
- test/message/array_diff_test.rb
|
163
|
+
- test/message/test_context_test.rb
|
164
|
+
- test/rescuing_test.rb
|
165
|
+
- test/separate.rb
|
166
|
+
- test/sexp_ext_test.rb
|
167
|
+
- test/string_comparison_test.rb
|
168
|
+
- test/suite.rb
|
169
|
+
- test/test_helper.rb
|
170
|
+
- test/wrong_test.rb
|
124
171
|
has_rdoc: true
|
125
172
|
homepage: http://github.com/sconover/wrong
|
126
173
|
licenses: []
|
@@ -129,68 +176,71 @@ post_install_message:
|
|
129
176
|
rdoc_options: []
|
130
177
|
|
131
178
|
require_paths:
|
132
|
-
|
179
|
+
- lib
|
133
180
|
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
134
182
|
requirements:
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
hash: 401403040534659610
|
186
|
+
segments:
|
187
|
+
- 0
|
188
|
+
version: "0"
|
140
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
+
none: false
|
141
191
|
requirements:
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
segments:
|
195
|
+
- 0
|
196
|
+
version: "0"
|
147
197
|
requirements: []
|
148
198
|
|
149
199
|
rubyforge_project: wrong
|
150
|
-
rubygems_version: 1.3.
|
200
|
+
rubygems_version: 1.3.7
|
151
201
|
signing_key:
|
152
202
|
specification_version: 3
|
153
203
|
summary: Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
|
154
204
|
test_files:
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
205
|
+
- test/adapters/minitest_test.rb
|
206
|
+
- test/adapters/railsapp/app/controllers/application_controller.rb
|
207
|
+
- test/adapters/railsapp/app/helpers/application_helper.rb
|
208
|
+
- test/adapters/railsapp/autotest/discover.rb
|
209
|
+
- test/adapters/railsapp/config/application.rb
|
210
|
+
- test/adapters/railsapp/config/boot.rb
|
211
|
+
- test/adapters/railsapp/config/environment.rb
|
212
|
+
- test/adapters/railsapp/config/environments/development.rb
|
213
|
+
- test/adapters/railsapp/config/environments/production.rb
|
214
|
+
- test/adapters/railsapp/config/environments/test.rb
|
215
|
+
- test/adapters/railsapp/config/initializers/backtrace_silencers.rb
|
216
|
+
- test/adapters/railsapp/config/initializers/inflections.rb
|
217
|
+
- test/adapters/railsapp/config/initializers/mime_types.rb
|
218
|
+
- test/adapters/railsapp/config/initializers/secret_token.rb
|
219
|
+
- test/adapters/railsapp/config/initializers/session_store.rb
|
220
|
+
- test/adapters/railsapp/config/routes.rb
|
221
|
+
- test/adapters/railsapp/db/seeds.rb
|
222
|
+
- test/adapters/railsapp/spec/spec_helper.rb
|
223
|
+
- test/adapters/railsapp/spec/wrong_spec.rb
|
224
|
+
- test/adapters/rspec1/failing_spec.rb
|
225
|
+
- test/adapters/rspec2/failing_spec.rb
|
226
|
+
- test/adapters/rspec_rails_test.rb
|
227
|
+
- test/adapters/rspec_test.rb
|
228
|
+
- test/adapters/test_unit_test.rb
|
229
|
+
- test/assert_advanced_test.rb
|
230
|
+
- test/assert_test.rb
|
231
|
+
- test/capturing_test.rb
|
232
|
+
- test/chunk_test.rb
|
233
|
+
- test/close_to_test.rb
|
234
|
+
- test/config_test.rb
|
235
|
+
- test/d_test.rb
|
236
|
+
- test/failure_message_test.rb
|
237
|
+
- test/failures_test.rb
|
238
|
+
- test/message/array_diff_test.rb
|
239
|
+
- test/message/test_context_test.rb
|
240
|
+
- test/rescuing_test.rb
|
241
|
+
- test/separate.rb
|
242
|
+
- test/sexp_ext_test.rb
|
243
|
+
- test/string_comparison_test.rb
|
244
|
+
- test/suite.rb
|
245
|
+
- test/test_helper.rb
|
246
|
+
- test/wrong_test.rb
|