rspec-cli 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWUxYmRlNWRjOTM1YjY0MDljNWI4ZWY2NWZmOWY0NDcwZTMwMzJhZg==
4
+ ZGFmNzdjYWFhMzE2YmM1ZDc5YjMzZDQ1MWZlNTk2YmZlODNjMjEwZg==
5
5
  data.tar.gz: !binary |-
6
- N2RhZTg3MjNiMGQ3ZWIxMGRmNjMwYzRkYmIxMjI3MTM5MmZhZmQ3OA==
6
+ YmQyMGZjZDcxMjAxZDM3N2QxNjhiNDliNzZjNWQ3ZThlZGZlYzc5Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTQyMzAyMmU0YTU0MjEzNjIxMDJkY2Q2Yjg1YTVlMzY5MDQwNjcyNWY5YWYz
10
- MDljNGUxMjE4NmI0NDA4MTFkNWQxZGM1NDhmMzdhZTk2ZGU1ODg4MTUzZDYx
11
- MzdjZjE4MWQ2YmRjNjc2Y2QxZTUxMjcwMmI2NTlkYTEwNTU3YTg=
9
+ MTI0Nzg2NjdhYjU1NmIxMTEwNzU1ZWI4NWFlYjE4MzVhOGVhNmU4ZTZjNzQw
10
+ NDE2NjQ1N2Q1Yzc3YTg4MmE4ZjVjYTdiMGVjY2M1ZmMzZDVkMTI1NDg2ZjZj
11
+ OTJhNWNhNmQ2NTE4ODFkZWMwMWNmMWJiYmE5NWY3NzZiNDk5OTU=
12
12
  data.tar.gz: !binary |-
13
- MDRlMGRjN2M1N2JmNjgyYmVlMTlmYTU5ZDVhZDZjYTM5YTU2ZTI2OTg3YjIz
14
- NTc0ZWIzYjVlZWNkZjQ3NTQ1MWM2NGEyYWYzNmEwZWM4MDZiNjE5YWFlMDEz
15
- NTUxNjQ1MWFmMzY4MjUzMWVmZDA2MDZhMGM1YWNmOGMwNDRjZDQ=
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 methads like ```#read``` to read from it's stdout, ```#write(string)``` to write to it's stdin and ```#status``` to get the process's status.
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
 
@@ -28,7 +28,7 @@ module RSpec
28
28
  def read_all(*args)
29
29
  assert_spawned
30
30
  @master.flush
31
- @master.ready_all *args
31
+ @master.read_all *args
32
32
  end
33
33
 
34
34
  def gets
@@ -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
- def ready_all nonblocking = false
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
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Cli
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -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.puts "hi, this"
40
- io_in.puts "is test data"
41
- expect(io_out.read_all(nonblocking: true)).to include "hi, this\nis test data"
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 include "hi there"
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.syswrite huge_string
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.1
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-10 00:00:00.000000000 Z
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.3.0
99
+ rubygems_version: 2.4.5
100
100
  signing_key:
101
101
  specification_version: 4
102
- summary: rspec-cli-0.2.1
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