bitcoin_testnet 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bitcoin_testnet.gemspec +2 -1
- data/lib/bitcoin_testnet.rb +2 -0
- data/lib/bitcoin_testnet/booter.rb +3 -3
- data/lib/bitcoin_testnet/executes.rb +11 -0
- data/lib/bitcoin_testnet/executor.rb +1 -1
- data/lib/bitcoin_testnet/prepares_command.rb +9 -0
- data/lib/bitcoin_testnet/version.rb +1 -1
- data/spec/bitcoint_testnet/executes_spec.rb +23 -0
- data/spec/bitcoint_testnet/executor_spec.rb +15 -0
- data/spec/bitcoint_testnet/prepares_command_spec.rb +14 -0
- data/spec/spec_helper.rb +2 -0
- metadata +27 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d5173e6e93a3f993ae68de6e310a1441b48d33c
|
4
|
+
data.tar.gz: 0fc26b7a364b16cdd7ec2b7b649085f3aa1576b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02f314f6cd294d0e47f40f347799ab6faafddb8a72108469cb5d5be8390b2d0b91dfdb22bc4b4aca94a9f318b48e3d19a18d6973b246aaa8a12a9b37f804f597
|
7
|
+
data.tar.gz: ca71d00a42d1f5502fa08bf922f1ee5eca9d7886870c80fddf5f4fed731f3611c4375e0115995719de5a6ff74a20547dd5d13608b768c9d8194dc9368f5e7268
|
data/CHANGELOG.md
CHANGED
data/bitcoin_testnet.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["ramon.tayag@gmail.com"]
|
11
11
|
gem.description = %q{A gem of helpers for making integration tests with the Bitcoin testnet a little easier.}
|
12
12
|
gem.summary = %q{A gem of helpers for making integration tests with the Bitcoin testnet a little easier.}
|
13
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "https://github.com/ramontayag/ruby-bitcoin_testnet"
|
14
14
|
|
15
15
|
testnet_files = `cd #{File.join(File.dirname(__FILE__), 'testnet')} && git ls-files`.split($/).map {|file| File.join('testnet', file)}
|
16
16
|
gem.files = `git ls-files`.split($/) + testnet_files
|
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
|
|
20
20
|
|
21
21
|
gem.add_dependency 'activesupport'
|
22
22
|
gem.add_dependency 'wait', '~> 0.5.1'
|
23
|
+
gem.add_development_dependency 'rspec'
|
23
24
|
end
|
data/lib/bitcoin_testnet.rb
CHANGED
@@ -6,6 +6,8 @@ require 'bitcoin_testnet/detector'
|
|
6
6
|
require 'bitcoin_testnet/executor'
|
7
7
|
require 'bitcoin_testnet/booter'
|
8
8
|
require 'bitcoin_testnet/stopper'
|
9
|
+
require 'bitcoin_testnet/executes'
|
10
|
+
require 'bitcoin_testnet/prepares_command'
|
9
11
|
require 'bitcoin_testnet/vcr_integrator'
|
10
12
|
|
11
13
|
module BitcoinTestnet
|
@@ -9,15 +9,15 @@ module BitcoinTestnet
|
|
9
9
|
if Detector.exists?
|
10
10
|
Stopper.stop
|
11
11
|
else
|
12
|
-
|
12
|
+
Executes.command "make clean"
|
13
13
|
end
|
14
14
|
|
15
15
|
thread = Thread.new do
|
16
|
-
|
16
|
+
Executes.command "make start"
|
17
17
|
end
|
18
18
|
|
19
19
|
Wait.new.until do
|
20
|
-
thread.status == false &&
|
20
|
+
thread.status == false && Executes.command("make getinfo")
|
21
21
|
end
|
22
22
|
|
23
23
|
unless Detector.exists?
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module BitcoinTestnet
|
4
|
+
describe Executes do
|
5
|
+
|
6
|
+
describe ".command" do
|
7
|
+
it "executes the prepared command in the BitcoinTestnet dir" do
|
8
|
+
in_dir = double
|
9
|
+
command = "do this"
|
10
|
+
prepared_command = "do this prepared"
|
11
|
+
|
12
|
+
allow(PreparesCommand).to receive(:for_silence).with(command).
|
13
|
+
and_return(prepared_command)
|
14
|
+
|
15
|
+
expect(Dir).to receive(:chdir).with(BitcoinTestnet.dir)
|
16
|
+
expect(described_class).to receive(:system).with(prepared_command)
|
17
|
+
|
18
|
+
described_class.command(command)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module BitcoinTestnet
|
4
|
+
describe PreparesCommand do
|
5
|
+
|
6
|
+
describe ".for_silence" do
|
7
|
+
it "redirects stdout and stderr to /dev/null" do
|
8
|
+
expect(described_class.for_silence("some command")).
|
9
|
+
to eq("some command > /dev/null 2>&1")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitcoin_testnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.5.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: A gem of helpers for making integration tests with the Bitcoin testnet
|
42
56
|
a little easier.
|
43
57
|
email:
|
@@ -57,10 +71,16 @@ files:
|
|
57
71
|
- lib/bitcoin_testnet.rb
|
58
72
|
- lib/bitcoin_testnet/booter.rb
|
59
73
|
- lib/bitcoin_testnet/detector.rb
|
74
|
+
- lib/bitcoin_testnet/executes.rb
|
60
75
|
- lib/bitcoin_testnet/executor.rb
|
76
|
+
- lib/bitcoin_testnet/prepares_command.rb
|
61
77
|
- lib/bitcoin_testnet/stopper.rb
|
62
78
|
- lib/bitcoin_testnet/vcr_integrator.rb
|
63
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
|
83
|
+
- spec/spec_helper.rb
|
64
84
|
- testnet/1/bitcoin.conf
|
65
85
|
- testnet/1/testnet3/blk0001.dat
|
66
86
|
- testnet/1/testnet3/blkindex.dat
|
@@ -75,7 +95,7 @@ files:
|
|
75
95
|
- testnet/2/testnet3/wallet.dat
|
76
96
|
- testnet/Makefile
|
77
97
|
- testnet/README.txt
|
78
|
-
homepage:
|
98
|
+
homepage: https://github.com/ramontayag/ruby-bitcoin_testnet
|
79
99
|
licenses: []
|
80
100
|
metadata: {}
|
81
101
|
post_install_message:
|
@@ -99,4 +119,8 @@ signing_key:
|
|
99
119
|
specification_version: 4
|
100
120
|
summary: A gem of helpers for making integration tests with the Bitcoin testnet a
|
101
121
|
little easier.
|
102
|
-
test_files:
|
122
|
+
test_files:
|
123
|
+
- spec/bitcoint_testnet/executes_spec.rb
|
124
|
+
- spec/bitcoint_testnet/executor_spec.rb
|
125
|
+
- spec/bitcoint_testnet/prepares_command_spec.rb
|
126
|
+
- spec/spec_helper.rb
|