did_you_mean 0.9.9 → 0.9.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5f3bcb4803e10d0fc470b852daabeb13100378f
4
- data.tar.gz: 1d0b43e694999ee1e512f5c55177e8d6e61538a1
3
+ metadata.gz: 0e4393a8458336e711929d466c09410195efbb64
4
+ data.tar.gz: 8e13dfcf17c8f44f67d926035a979361e09361ee
5
5
  SHA512:
6
- metadata.gz: b62459e83c059e069c7a43a5e67161044757a636bcbb570205cf8bba3b1f21076e9e2843dbcc8030dc8c917297a1a9df4f6442456c6a7b0f6f903a24e677e51d
7
- data.tar.gz: a921df196d4a1be1074660d7b6988bae7d81c460d82324bd1ca9201f9c3fa8b488b1682eaeaac856907eb045f801569958a13fffb5cdbd921ee1fafd49baa96f
6
+ metadata.gz: 7b412e37b9e436bdc0d61de40d9589835769a3d6ec77a715a2be7a40a24d5068adc90f54dd2455d336b0dc4c83b865dabcec081ec53fcb50b84ae31dea6b2174
7
+ data.tar.gz: 31b0878bf5162ed664d631b3acd2575ffe6127a15e5eecfc6b3b450a4c063074150cc005923de49d80a5ec28020d92b14d25f998217b1486dc57f05331b3c80f
@@ -8,7 +8,7 @@ class NameError
8
8
  private_constant :IGNORED_CALLERS
9
9
 
10
10
  def to_s_with_did_you_mean
11
- msg = original_message
11
+ msg = original_message.dup
12
12
  bt = caller.first(6)
13
13
 
14
14
  msg << did_you_mean?.to_s if IGNORED_CALLERS.all? {|ignored| bt.grep(ignored).empty? }
@@ -1,3 +1,3 @@
1
1
  module DidYouMean
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.10"
3
3
  end
@@ -21,6 +21,14 @@ class NameErrorExtensionTest < Minitest::Test
21
21
  assert_match "Y U SO SLOW?", @error.to_s
22
22
  assert_match "Y U SO SLOW?", @error.message
23
23
  end
24
+
25
+ def test_to_s_does_not_make_disruptive_changes_to_error_message
26
+ error = assert_raises(NameError) do
27
+ raise NameError, "uninitialized constant Object".freeze
28
+ end
29
+
30
+ assert_equal 1, error.to_s.scan("Y U SO SLOW?").count
31
+ end
24
32
  end
25
33
 
26
34
  class IgnoreCallersTest < Minitest::Test
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: did_you_mean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Nishijima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: interception