test-cmd.rb 2.7.0 → 2.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c42ecb86960f6c733054ea3cd7ed041c23accec019f7addb7a2a595020b507bf
4
- data.tar.gz: 05fd256aa2c70bb23e8e9ef3e3f8e91eb9bcff9fa2680f48a059960333e74b06
3
+ metadata.gz: 79bec627803ce82d85c99a7f55f00b007cdfba9ecf54634b8c48e9fa64083b17
4
+ data.tar.gz: 73ab470f82fc83f120ab84c5a4345ce6da2c417edf121e24db314ba2cd9b1dad
5
5
  SHA512:
6
- metadata.gz: e2c4e2b3858f7b090359a46756a54408d28c729603f0f47ccda5a68c35e2c11dd807dade25cf79d88af938861a112b582d9ecea0198d4b2023ab6fba504ba63d
7
- data.tar.gz: 7efb00552507bbbb2b1d66e599ccdd165e7acb3628f5a5e97daa2ec0bdafca5e63ebce274d937a737224836db806a171d4f8bbd07b2195bc092aa529ddacc2d8
6
+ metadata.gz: e9d84416530c7becb5915bca84d2bc7eb17532d0bbb53756d205ab2ba06c6f63999ad395ca206e6a943d6f24fc2ce3913b0db7061164bab018499021a3705e20
7
+ data.tar.gz: 6aedc2200539e08f31eebd9d480cbb3c7a4ee0096e477d153a969096df542e79e5b3ac236ebabce6c476bba9f3fce2c3b5210c97e5378d9dd50a3e6fbc406d9c
@@ -4,5 +4,5 @@ end unless defined?(Test)
4
4
  class Test::Command
5
5
  ##
6
6
  # @string [String]
7
- VERSION = "2.7.0"
7
+ VERSION = "2.7.1"
8
8
  end
data/lib/test/command.rb CHANGED
@@ -117,6 +117,7 @@ class Test::Command
117
117
  # writer thread does not block forever.
118
118
  @in_r.close unless @in_r.equal?(IO::NULL)
119
119
  @status = Process.waitpid2(Process.spawn("false")).last
120
+ self
120
121
  end
121
122
 
122
123
  ##
data/test/cmd_test.rb CHANGED
@@ -239,5 +239,27 @@ class Test::Command
239
239
  assert_equal true, ::Test::Command.new("/a/path/that/is/not/found").command_not_found?
240
240
  assert_equal true, ::Test::Command.new("/a/path/that/is/not/found").not_found?
241
241
  end
242
+
243
+ def test_spawn_returns_self_when_not_found
244
+ command = ::Test::Command.new("/a/path/that/is/not/found")
245
+ assert_equal command, command.spawn
246
+ end
247
+
248
+ def test_spawn_sets_not_found_on_self
249
+ command = ::Test::Command.new("/a/path/that/is/not/found")
250
+ command.spawn
251
+ assert_equal true, command.not_found?
252
+ end
253
+
254
+ def test_stdout_when_not_found
255
+ command = ::Test::Command.new("/a/path/that/is/not/found")
256
+ assert_equal "", command.stdout
257
+ end
258
+
259
+ def test_stderr_when_not_found
260
+ command = ::Test::Command.new("/a/path/that/is/not/found")
261
+ assert_equal "No such file or directory - /a/path/that/is/not/found",
262
+ command.stderr
263
+ end
242
264
  end
243
265
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-cmd.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gleeson