Commit 3dcafc73a435baf12a7b655880d06e2709c97300

Authored by comboy
Committed by Julian Langschaedel
1 parent 810ba7314c

fix test failing on ruby 2.0

We are only adding @addr in before, so expectation wasn't matching for
newly generated key, I still have no idea why it wasn't failing on 1.9

Showing 1 changed file with 5 additions and 7 deletions Side-by-side Diff

spec/bitcoin/wallet/wallet_spec.rb
... ... @@ -46,14 +46,12 @@
46 46 @storage = Mock.new
47 47 @key = Key.from_base58('5J2hn1E8KEXmQn5gqykzKotyCcHbKrVbe8fjegsfVXRdv6wwon8')
48 48 @addr = '1M89ZeWtmZmATzE3b6PHTBi8c7tGsg5xpo'
49   - @key2 = Key.from_base58('5KK9Lw8gtNd4kcaXQJmkwcmNy8Y5rLGm49RqhcYAb7qRhWxaWMJ')
50   - @addr2 = '134A4Bi8jN5V2KjkwmXUHjokDqdyqZ778J'
51   - @key3 = Key.from_base58('5JFcJByQvwYnWjQ2RHTTu6LLGiBj9oPQYsHqKWuKLDVAvv4cQ7E')
52   - @addr3 = '1EnrPVaRiRgrs1D7pujYZNN1N6iD9unZV6'
  49 + #@key2 = Key.from_base58('5KK9Lw8gtNd4kcaXQJmkwcmNy8Y5rLGm49RqhcYAb7qRhWxaWMJ')
  50 + #@addr2 = '134A4Bi8jN5V2KjkwmXUHjokDqdyqZ778J'
  51 + #@key3 = Key.from_base58('5JFcJByQvwYnWjQ2RHTTu6LLGiBj9oPQYsHqKWuKLDVAvv4cQ7E')
  52 + #@addr3 = '1EnrPVaRiRgrs1D7pujYZNN1N6iD9unZV6'
53 53  
54 54 @storage.expect(:add_watched_address, [], [@addr])
55   - @storage.expect(:add_watched_address, [], [@addr2])
56   - @storage.expect(:add_watched_address, [], [@addr3])
57 55  
58 56 keystore_data = [{:addr => @key.addr, :priv => @key.priv, :pub => @key.pub}]
59 57 file_stub = StringIO.new
... ... @@ -103,7 +101,7 @@
103 101 it "should create new addr" do
104 102 @wallet.addrs.size.should == 1
105 103  
106   - key = Key.generate
  104 + @storage.expect(:add_watched_address, [], [String])
107 105 a = @wallet.get_new_addr
108 106 @wallet.addrs.size.should == 2
109 107 @wallet.addrs[1].should == a