bitcoin_testnet 0.5.0 → 0.5.1

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: 7d5173e6e93a3f993ae68de6e310a1441b48d33c
4
- data.tar.gz: 0fc26b7a364b16cdd7ec2b7b649085f3aa1576b8
3
+ metadata.gz: 2fcbe4320fd084077ac6c4a41b014f5d48714471
4
+ data.tar.gz: cc94f8ec6da3d51bb8f6f151a4992d581439a3a2
5
5
  SHA512:
6
- metadata.gz: 02f314f6cd294d0e47f40f347799ab6faafddb8a72108469cb5d5be8390b2d0b91dfdb22bc4b4aca94a9f318b48e3d19a18d6973b246aaa8a12a9b37f804f597
7
- data.tar.gz: ca71d00a42d1f5502fa08bf922f1ee5eca9d7886870c80fddf5f4fed731f3611c4375e0115995719de5a6ff74a20547dd5d13608b768c9d8194dc9368f5e7268
6
+ metadata.gz: 769cd0647c62e03aab1e14591a0de373bf27d8c7bd399a36d0ddcc3d3ef346efb0fbbbe96697e65ddc50f6b4d31a0a7f5402abb8ec97b8df912ce4a8229d6b9a
7
+ data.tar.gz: 6e0c20e4a8cb9933d094c86c1c9429a6d1fdcbf6f1f26f26edb2e3259e493b7f2bf12ab2f8401b84bc91b8ef3876cff47d298c67b6d4c440bbc753945fbd9cb2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.5.1
2
+
3
+ - Do not record the vcr cassette if the example fails [#6]
4
+
1
5
  # v0.5.0
2
6
 
3
7
  - Redirect all bitcoin make logging to /dev/null -- makes things more quiet when running specs
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in bitcoin_testnet.gemspec
4
4
  gemspec
5
+
6
+ gem "pry", "0.9.12.2"
data/README.md CHANGED
@@ -14,14 +14,14 @@ Second, you have to tell BitcoinTestnet where the testnet in a box directory is.
14
14
 
15
15
  git submodule add https://github.com/freewil/bitcoin-testnet-box spec/testnet
16
16
 
17
+ See the readme of `bitcoin-testnet-box` to see what version of `bitcoind` to install. The test net you download is configured with a certain version of the bitcoin daemon.
18
+
17
19
  Then, in your `test_helper`/`spec_helper`:
18
20
 
19
21
  BitcoinTestnet.dir = "spec/testnet"
20
22
 
21
23
  Third, tell `BitcoinTestnet` when to do its work:
22
24
 
23
- **Note**: if you user RSpec and VCR, see "RSpec and VCR" section below.
24
-
25
25
  - Before each spec, call `BitcoinTestnet.start`. This will start and clean the Testnet, so it looks like it did the first time you started the Testnet.
26
26
  - After the test suite is finished, call `BitcoinTestnet.stop`. This turns off the Testnet.
27
27
 
@@ -15,6 +15,9 @@ module BitcoinTestnet
15
15
  mattr_accessor :dir
16
16
  @@dir = nil
17
17
 
18
+ mattr_accessor :current_test
19
+ @@current_test = nil
20
+
18
21
  def self.start
19
22
  Booter.boot
20
23
  end
@@ -28,6 +31,12 @@ module BitcoinTestnet
28
31
  c.before(:each) { VcrIntegrator.start(example) }
29
32
  c.after(:each) { VcrIntegrator.stop(example) }
30
33
  end
34
+
35
+ VCR.configure do |c|
36
+ c.before_record do |interaction|
37
+ interaction.ignore! if BitcoinTestnet.current_test.exception
38
+ end
39
+ end
31
40
  end
32
41
 
33
42
  end
@@ -10,7 +10,7 @@ module BitcoinTestnet
10
10
  end
11
11
 
12
12
  def initialize(rspec_example)
13
- @rspec_example = rspec_example
13
+ BitcoinTestnet.current_test = @rspec_example = rspec_example
14
14
  end
15
15
 
16
16
  def start
@@ -1,3 +1,3 @@
1
1
  module BitcoinTestnet
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -0,0 +1,15 @@
1
+ require "spec_helper"
2
+
3
+ module BitcoinTestnet
4
+ describe VcrIntegrator do
5
+
6
+ describe ".start" do
7
+ it "sets the BitcoinTestnet.current_test to be the given test" do
8
+ test = double(metadata: {})
9
+ described_class.start(test)
10
+ expect(BitcoinTestnet.current_test).to eq(test)
11
+ end
12
+ end
13
+
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin_testnet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-01 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -77,9 +77,10 @@ files:
77
77
  - lib/bitcoin_testnet/stopper.rb
78
78
  - lib/bitcoin_testnet/vcr_integrator.rb
79
79
  - lib/bitcoin_testnet/version.rb
80
- - spec/bitcoint_testnet/executes_spec.rb
81
- - spec/bitcoint_testnet/executor_spec.rb
82
- - spec/bitcoint_testnet/prepares_command_spec.rb
80
+ - spec/bitcoin_testnet/executes_spec.rb
81
+ - spec/bitcoin_testnet/executor_spec.rb
82
+ - spec/bitcoin_testnet/prepares_command_spec.rb
83
+ - spec/bitcoin_testnet/vcr_integrator_spec.rb
83
84
  - spec/spec_helper.rb
84
85
  - testnet/1/bitcoin.conf
85
86
  - testnet/1/testnet3/blk0001.dat
@@ -120,7 +121,8 @@ specification_version: 4
120
121
  summary: A gem of helpers for making integration tests with the Bitcoin testnet a
121
122
  little easier.
122
123
  test_files:
123
- - spec/bitcoint_testnet/executes_spec.rb
124
- - spec/bitcoint_testnet/executor_spec.rb
125
- - spec/bitcoint_testnet/prepares_command_spec.rb
124
+ - spec/bitcoin_testnet/executes_spec.rb
125
+ - spec/bitcoin_testnet/executor_spec.rb
126
+ - spec/bitcoin_testnet/prepares_command_spec.rb
127
+ - spec/bitcoin_testnet/vcr_integrator_spec.rb
126
128
  - spec/spec_helper.rb