wrong 0.4.5 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
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
- expect { BleuCheese.new.smell > 9000 }
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 feel free to 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
+ 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 the correct level.
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. So now we do. Call
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
@@ -26,7 +26,7 @@ end
26
26
  require "wrong/close_to"
27
27
 
28
28
  # ...don't `require 'wrong'`, and `include Wrong::D` only in the modules you want to call `d` from
29
- class Object
29
+ class Object # should we add this to Kernel instead?
30
30
  include Wrong::D
31
31
  end
32
32
 
@@ -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 ::Sourcify::MultipleMatchingProcsPerLineError, Racc::ParseError, Errno::ENOENT => e
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 assertion at #{file}:#{line_number} [couldn't retrieve source code due to #{e.inspect}]"
140
- raise failure_class.new(message)
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 = indent_all(3, value.inspect)
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(2, part, " is ", value)
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(2, part, " ", raises, ": ", indent_all(3, e.message))
227
+ indent(4, part, " ", raises, ": ", indent_all(6, e.message))
211
228
  else
212
- indent(2, part, " ", raises)
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
- "#{" " * indent}#{s.join('')}"
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
@@ -1,3 +1,3 @@
1
1
  module Wrong
2
- VERSION = "0.4.5" unless defined?(Wrong::VERSION)
2
+ VERSION = "0.5.0" unless defined?(Wrong::VERSION)
3
3
  end
@@ -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 }
@@ -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? "1 example, 1 failure" }
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
- require "./test/test_helper"
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("test") do
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
- it "indents unescaped newlines inside the inspected value" do
266
- weirdo = Object.new
267
-
268
- def weirdo.inspect
269
- "first\nsecond\nthird"
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
- x = weirdo
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
@@ -57,7 +57,9 @@ describe "d" do
57
57
 
58
58
  it "works when called on the D module" do
59
59
  x = 9
60
- output = capturing { Wrong::D.d { x }}
60
+ output = capturing {
61
+ Wrong::D.d { x }
62
+ }
61
63
  assert { output == "x is 9\n" }
62
64
  end
63
65
 
@@ -83,7 +83,7 @@ module Wrong
83
83
  end
84
84
  assert { message.full.include? ", but\n (2 + 2) is 4"}
85
85
  end
86
-
86
+
87
87
  end
88
88
 
89
89
  end
metadata CHANGED
@@ -3,129 +3,137 @@ name: wrong
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 0
7
- - 4
8
- - 5
9
- version: 0.4.5
6
+ - 0
7
+ - 5
8
+ - 0
9
+ version: 0.5.0
10
10
  platform: ruby
11
11
  authors:
12
- - Steve Conover
13
- - Alex Chaffee
12
+ - Steve Conover
13
+ - Alex Chaffee
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-12 00:00:00 -08:00
18
+ date: 2010-12-08 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: predicated
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- - 2
30
- - 2
31
- version: 0.2.2
32
- requirement: *id001
33
- prerelease: false
34
- type: :runtime
35
- - !ruby/object:Gem::Dependency
36
- name: ruby_parser
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ~>
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 2
43
- - 0
44
- - 4
45
- version: 2.0.4
46
- requirement: *id002
47
- prerelease: false
48
- type: :runtime
49
- - !ruby/object:Gem::Dependency
50
- name: ruby2ruby
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ~>
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 1
57
- - 2
58
- version: "1.2"
59
- requirement: *id003
60
- prerelease: false
61
- type: :runtime
62
- - !ruby/object:Gem::Dependency
63
- name: sexp_processor
64
- version_requirements: &id004 !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- segments:
69
- - 3
70
- - 0
71
- version: "3.0"
72
- requirement: *id004
73
- prerelease: false
74
- type: :runtime
75
- - !ruby/object:Gem::Dependency
76
- name: diff-lcs
77
- version_requirements: &id005 !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ~>
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 1
83
- - 1
84
- - 2
85
- version: 1.1.2
86
- requirement: *id005
87
- prerelease: false
88
- type: :runtime
89
- - !ruby/object:Gem::Dependency
90
- name: ParseTree
91
- version_requirements: &id006 !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ~>
94
- - !ruby/object:Gem::Version
95
- segments:
96
- - 3
97
- - 0
98
- version: "3.0"
99
- requirement: *id006
100
- prerelease: false
101
- type: :runtime
102
- - !ruby/object:Gem::Dependency
103
- name: sourcify
104
- version_requirements: &id007 !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- segments:
109
- - 0
110
- - 3
111
- - 0
112
- version: 0.3.0
113
- requirement: *id007
114
- prerelease: false
115
- type: :runtime
116
- - !ruby/object:Gem::Dependency
117
- name: file-tail
118
- version_requirements: &id008 !ruby/object:Gem::Requirement
119
- requirements:
120
- - - ~>
121
- - !ruby/object:Gem::Version
122
- segments:
123
- - 1
124
- - 0
125
- version: "1.0"
126
- requirement: *id008
127
- prerelease: false
128
- type: :runtime
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
94
+ - !ruby/object:Gem::Dependency
95
+ name: ParseTree
96
+ requirement: &id006 !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ segments:
102
+ - 3
103
+ - 0
104
+ version: "3.0"
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: *id006
108
+ - !ruby/object:Gem::Dependency
109
+ name: sourcify
110
+ requirement: &id007 !ruby/object:Gem::Requirement
111
+ none: false
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ segments:
116
+ - 0
117
+ - 3
118
+ - 0
119
+ version: 0.3.0
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: *id007
123
+ - !ruby/object:Gem::Dependency
124
+ name: file-tail
125
+ requirement: &id008 !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ~>
129
+ - !ruby/object:Gem::Version
130
+ segments:
131
+ - 1
132
+ - 0
133
+ version: "1.0"
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: *id008
129
137
  description: |-
130
138
  Wrong provides a general assert method that takes a predicate block. Assertion failure
131
139
  messages are rich in detail. The Wrong idea is to replace all those countless assert_this,
@@ -139,28 +147,70 @@ executables: []
139
147
  extensions: []
140
148
 
141
149
  extra_rdoc_files:
142
- - README.markdown
150
+ - README.markdown
143
151
  files:
144
- - lib/wrong.rb
145
- - lib/wrong/assert.rb
146
- - lib/wrong/chunk.rb
147
- - lib/wrong/close_to.rb
148
- - lib/wrong/config.rb
149
- - lib/wrong/d.rb
150
- - lib/wrong/failure_message.rb
151
- - lib/wrong/helpers.rb
152
- - lib/wrong/irb.rb
153
- - lib/wrong/rainbow.rb
154
- - lib/wrong/ruby2ruby_patch.rb
155
- - lib/wrong/sexp_ext.rb
156
- - lib/wrong/version.rb
157
- - lib/wrong/adapters/minitest.rb
158
- - lib/wrong/adapters/rspec.rb
159
- - lib/wrong/adapters/test_unit.rb
160
- - lib/wrong/message/array_diff.rb
161
- - lib/wrong/message/string_comparison.rb
162
- - lib/wrong/message/test_context.rb
163
- - README.markdown
152
+ - lib/wrong/adapters/minitest.rb
153
+ - lib/wrong/adapters/rspec.rb
154
+ - lib/wrong/adapters/test_unit.rb
155
+ - lib/wrong/assert.rb
156
+ - lib/wrong/chunk.rb
157
+ - lib/wrong/close_to.rb
158
+ - lib/wrong/config.rb
159
+ - lib/wrong/d.rb
160
+ - lib/wrong/failure_message.rb
161
+ - lib/wrong/helpers.rb
162
+ - lib/wrong/irb.rb
163
+ - lib/wrong/message/array_diff.rb
164
+ - lib/wrong/message/string_comparison.rb
165
+ - lib/wrong/message/test_context.rb
166
+ - lib/wrong/rainbow.rb
167
+ - lib/wrong/ruby2ruby_patch.rb
168
+ - lib/wrong/sexp_ext.rb
169
+ - lib/wrong/version.rb
170
+ - lib/wrong.rb
171
+ - README.markdown
172
+ - test/adapters/minitest_test.rb
173
+ - test/adapters/railsapp/app/controllers/application_controller.rb
174
+ - test/adapters/railsapp/app/helpers/application_helper.rb
175
+ - test/adapters/railsapp/autotest/discover.rb
176
+ - test/adapters/railsapp/config/application.rb
177
+ - test/adapters/railsapp/config/boot.rb
178
+ - test/adapters/railsapp/config/environment.rb
179
+ - test/adapters/railsapp/config/environments/development.rb
180
+ - test/adapters/railsapp/config/environments/production.rb
181
+ - test/adapters/railsapp/config/environments/test.rb
182
+ - test/adapters/railsapp/config/initializers/backtrace_silencers.rb
183
+ - test/adapters/railsapp/config/initializers/inflections.rb
184
+ - test/adapters/railsapp/config/initializers/mime_types.rb
185
+ - test/adapters/railsapp/config/initializers/secret_token.rb
186
+ - test/adapters/railsapp/config/initializers/session_store.rb
187
+ - test/adapters/railsapp/config/routes.rb
188
+ - test/adapters/railsapp/db/seeds.rb
189
+ - test/adapters/railsapp/spec/spec_helper.rb
190
+ - test/adapters/railsapp/spec/wrong_spec.rb
191
+ - test/adapters/rspec1/failing_spec.rb
192
+ - test/adapters/rspec2/failing_spec.rb
193
+ - test/adapters/rspec_rails_test.rb
194
+ - test/adapters/rspec_test.rb
195
+ - test/adapters/test_unit_test.rb
196
+ - test/assert_advanced_test.rb
197
+ - test/assert_test.rb
198
+ - test/capturing_test.rb
199
+ - test/chunk_test.rb
200
+ - test/close_to_test.rb
201
+ - test/config_test.rb
202
+ - test/d_test.rb
203
+ - test/failure_message_test.rb
204
+ - test/failures_test.rb
205
+ - test/message/array_diff_test.rb
206
+ - test/message/test_context_test.rb
207
+ - test/rescuing_test.rb
208
+ - test/separate.rb
209
+ - test/sexp_ext_test.rb
210
+ - test/string_comparison_test.rb
211
+ - test/suite.rb
212
+ - test/test_helper.rb
213
+ - test/wrong_test.rb
164
214
  has_rdoc: true
165
215
  homepage: http://github.com/sconover/wrong
166
216
  licenses: []
@@ -169,68 +219,71 @@ post_install_message:
169
219
  rdoc_options: []
170
220
 
171
221
  require_paths:
172
- - lib
222
+ - lib
173
223
  required_ruby_version: !ruby/object:Gem::Requirement
224
+ none: false
174
225
  requirements:
175
- - - ">="
176
- - !ruby/object:Gem::Version
177
- segments:
178
- - 0
179
- version: "0"
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ hash: -2030661794570010532
229
+ segments:
230
+ - 0
231
+ version: "0"
180
232
  required_rubygems_version: !ruby/object:Gem::Requirement
233
+ none: false
181
234
  requirements:
182
- - - ">="
183
- - !ruby/object:Gem::Version
184
- segments:
185
- - 0
186
- version: "0"
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ segments:
238
+ - 0
239
+ version: "0"
187
240
  requirements: []
188
241
 
189
242
  rubyforge_project: wrong
190
- rubygems_version: 1.3.6
243
+ rubygems_version: 1.3.7
191
244
  signing_key:
192
245
  specification_version: 3
193
246
  summary: Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
194
247
  test_files:
195
- - test/assert_advanced_test.rb
196
- - test/assert_test.rb
197
- - test/capturing_test.rb
198
- - test/chunk_test.rb
199
- - test/close_to_test.rb
200
- - test/config_test.rb
201
- - test/d_test.rb
202
- - test/failure_message_test.rb
203
- - test/failures_test.rb
204
- - test/rescuing_test.rb
205
- - test/separate.rb
206
- - test/sexp_ext_test.rb
207
- - test/string_comparison_test.rb
208
- - test/suite.rb
209
- - test/test_helper.rb
210
- - test/wrong_test.rb
211
- - test/adapters/minitest_test.rb
212
- - test/adapters/rspec_rails_test.rb
213
- - test/adapters/rspec_test.rb
214
- - test/adapters/test_unit_test.rb
215
- - test/adapters/railsapp/app/controllers/application_controller.rb
216
- - test/adapters/railsapp/app/helpers/application_helper.rb
217
- - test/adapters/railsapp/autotest/discover.rb
218
- - test/adapters/railsapp/config/application.rb
219
- - test/adapters/railsapp/config/boot.rb
220
- - test/adapters/railsapp/config/environment.rb
221
- - test/adapters/railsapp/config/routes.rb
222
- - test/adapters/railsapp/config/environments/development.rb
223
- - test/adapters/railsapp/config/environments/production.rb
224
- - test/adapters/railsapp/config/environments/test.rb
225
- - test/adapters/railsapp/config/initializers/backtrace_silencers.rb
226
- - test/adapters/railsapp/config/initializers/inflections.rb
227
- - test/adapters/railsapp/config/initializers/mime_types.rb
228
- - test/adapters/railsapp/config/initializers/secret_token.rb
229
- - test/adapters/railsapp/config/initializers/session_store.rb
230
- - test/adapters/railsapp/db/seeds.rb
231
- - test/adapters/railsapp/spec/spec_helper.rb
232
- - test/adapters/railsapp/spec/wrong_spec.rb
233
- - test/adapters/rspec1/failing_spec.rb
234
- - test/adapters/rspec2/failing_spec.rb
235
- - test/message/array_diff_test.rb
236
- - test/message/test_context_test.rb
248
+ - test/adapters/minitest_test.rb
249
+ - test/adapters/railsapp/app/controllers/application_controller.rb
250
+ - test/adapters/railsapp/app/helpers/application_helper.rb
251
+ - test/adapters/railsapp/autotest/discover.rb
252
+ - test/adapters/railsapp/config/application.rb
253
+ - test/adapters/railsapp/config/boot.rb
254
+ - test/adapters/railsapp/config/environment.rb
255
+ - test/adapters/railsapp/config/environments/development.rb
256
+ - test/adapters/railsapp/config/environments/production.rb
257
+ - test/adapters/railsapp/config/environments/test.rb
258
+ - test/adapters/railsapp/config/initializers/backtrace_silencers.rb
259
+ - test/adapters/railsapp/config/initializers/inflections.rb
260
+ - test/adapters/railsapp/config/initializers/mime_types.rb
261
+ - test/adapters/railsapp/config/initializers/secret_token.rb
262
+ - test/adapters/railsapp/config/initializers/session_store.rb
263
+ - test/adapters/railsapp/config/routes.rb
264
+ - test/adapters/railsapp/db/seeds.rb
265
+ - test/adapters/railsapp/spec/spec_helper.rb
266
+ - test/adapters/railsapp/spec/wrong_spec.rb
267
+ - test/adapters/rspec1/failing_spec.rb
268
+ - test/adapters/rspec2/failing_spec.rb
269
+ - test/adapters/rspec_rails_test.rb
270
+ - test/adapters/rspec_test.rb
271
+ - test/adapters/test_unit_test.rb
272
+ - test/assert_advanced_test.rb
273
+ - test/assert_test.rb
274
+ - test/capturing_test.rb
275
+ - test/chunk_test.rb
276
+ - test/close_to_test.rb
277
+ - test/config_test.rb
278
+ - test/d_test.rb
279
+ - test/failure_message_test.rb
280
+ - test/failures_test.rb
281
+ - test/message/array_diff_test.rb
282
+ - test/message/test_context_test.rb
283
+ - test/rescuing_test.rb
284
+ - test/separate.rb
285
+ - test/sexp_ext_test.rb
286
+ - test/string_comparison_test.rb
287
+ - test/suite.rb
288
+ - test/test_helper.rb
289
+ - test/wrong_test.rb