rspec-cli 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +4 -1
- data/lib/rspec/cli/cli_process.rb +1 -1
- data/lib/rspec/cli/i_o_decorator.rb +5 -1
- data/lib/rspec/cli/version.rb +1 -1
- data/spec/cli/i_o_decorator_spec.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGFmNzdjYWFhMzE2YmM1ZDc5YjMzZDQ1MWZlNTk2YmZlODNjMjEwZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmQyMGZjZDcxMjAxZDM3N2QxNjhiNDliNzZjNWQ3ZThlZGZlYzc5Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTI0Nzg2NjdhYjU1NmIxMTEwNzU1ZWI4NWFlYjE4MzVhOGVhNmU4ZTZjNzQw
|
10
|
+
NDE2NjQ1N2Q1Yzc3YTg4MmE4ZjVjYTdiMGVjY2M1ZmMzZDVkMTI1NDg2ZjZj
|
11
|
+
OTJhNWNhNmQ2NTE4ODFkZWMwMWNmMWJiYmE5NWY3NzZiNDk5OTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmI4ZWM0OTcwZWQ1NmQ5MzIzYTYyYjMzNzI5N2YxNGExYjk4NjA0MTVhZGYw
|
14
|
+
MmU2YmUwMzJkMGUzZWNjZTVmMzk5ODc5NTFiN2Q3OTMyYmJhN2I3NTY0M2Zm
|
15
|
+
OTUzNDdmNzg5ZGQ3MzdlOTc1NGVjNzU4MTM2NzYwZTRjN2EwYjU=
|
data/README.md
CHANGED
@@ -39,7 +39,10 @@ The first one returns a CliProcess instance that hasn't spawned your command yet
|
|
39
39
|
|
40
40
|
The second one returns a CliProcess instance that has spawned your command.
|
41
41
|
|
42
|
-
The CliProcess instance has some useful
|
42
|
+
The CliProcess instance has some useful methods like ```#read_all``` to read from it's stdout, ```#write(string)``` to write to it's stdin and ```#status``` to get the process's status.
|
43
|
+
|
44
|
+
## Versioning
|
45
|
+
As close to semantic versioning as I can be sure of (earlier in the project I broke semantic versioning, but everything past tag 0.2.0 is correct)
|
43
46
|
|
44
47
|
## Contributing
|
45
48
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'pty'
|
2
2
|
require 'delegate'
|
3
|
+
require 'timeout'
|
3
4
|
|
4
5
|
module RSpec
|
5
6
|
|
@@ -11,7 +12,10 @@ module RSpec
|
|
11
12
|
IO.select([self], nil, nil, timeout) ? true : false
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
+
# This fails on huge data blocks. the has_data? thing migth be
|
16
|
+
# returning false when the system is about to refill the stream
|
17
|
+
# with more data. Essentially a race condition
|
18
|
+
def read_all nonblocking = false
|
15
19
|
if nonblocking && !has_data?
|
16
20
|
return nil
|
17
21
|
end
|
data/lib/rspec/cli/version.rb
CHANGED
@@ -36,9 +36,9 @@ describe RSpec::Cli::IODecorator do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "returns all the data if there is data" do
|
39
|
-
io_in.
|
40
|
-
io_in.
|
41
|
-
expect(io_out.read_all(nonblocking: true)).to
|
39
|
+
io_in.write "hi, this"
|
40
|
+
io_in.write " is test data"
|
41
|
+
expect(io_out.read_all(nonblocking: true)).to eq "hi, this is test data"
|
42
42
|
end
|
43
43
|
|
44
44
|
it "doesn't fall into a race condition with another process interacting with it" do
|
@@ -50,7 +50,7 @@ describe RSpec::Cli::IODecorator do
|
|
50
50
|
@pid = PTY.spawn(command, in: slave_tty, out: slave_tty, err: slave_tty)[2]
|
51
51
|
|
52
52
|
master.write "hi there"
|
53
|
-
expect(master.read_all).to
|
53
|
+
expect(master.read_all).to eq "hi there"
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -80,7 +80,7 @@ describe RSpec::Cli::IODecorator do
|
|
80
80
|
# while the system waits for the buffer to be read from,
|
81
81
|
# so we do the write in a new thread.
|
82
82
|
Thread.new do
|
83
|
-
io_in.
|
83
|
+
io_in.write huge_string
|
84
84
|
end
|
85
85
|
|
86
86
|
expect(test).to change{data}.to huge_string
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sia. S.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,10 +96,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.4.5
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
|
-
summary: rspec-cli-0.2.
|
102
|
+
summary: rspec-cli-0.2.2
|
103
103
|
test_files:
|
104
104
|
- spec/cli/cli_process_spec.rb
|
105
105
|
- spec/cli/i_o_decorator_spec.rb
|