test-cmd.rb 0.7.0 → 0.8.0

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
  SHA256:
3
- metadata.gz: 4a40537381e81f677332c21cfbc95b997fe0f89a4cbf4c714e2eb857da496554
4
- data.tar.gz: 88ceffc1c05ed2b90f79c39c73c6a95adc5ccd9bce97ff435dea3dbea07feb89
3
+ metadata.gz: 3271a0fc385b5c2ec050a4295cfd9c67b662dca479a1e5c197610fb0f773fb8b
4
+ data.tar.gz: da1a24b436cfde2e63a6fccdaf6ac5d597f180f10b578319549713e64992a095
5
5
  SHA512:
6
- metadata.gz: 362b5b2155218c63f01321c279ebb5a7cd204fbdb01af2e76ce3d767d30c4b3a13c2a2eec52de77f7bb80419d37f7fdadb44ce1c3fb97e42d708d916a0eedfa1
7
- data.tar.gz: 055f87c0d765be7ec2612ba9ae3e0f49cdaf2458eac747c8399b8b57dda732dca20d4848d9cc6809393fb3dfbd295cf2d55aec50eee9fbec7f8a63d37ef8a466
6
+ metadata.gz: bf4e1638056aa03ce82db25547efe1ad9c2bbb2ac737a3ec13b9f8c23576c090101b59c19ce7adf554a2b47e9ae16d9fac6439e730c74423a8fe37e317be745d
7
+ data.tar.gz: 82c83edc676b854ffa3e96930a6d6b6d51e3ab484df093f1919529e5abc9914e6ff0bc65180733ed0434d48fdee15be93bbe5ff7526e422f2ff57e56c061a4c7
data/README.md CHANGED
@@ -47,7 +47,7 @@ covers it in more-depth:
47
47
  ``` ruby
48
48
  require "test/cmd"
49
49
  puts cmd("du")
50
- .args("-s", "-h")
50
+ .argv("-s", "-h")
51
51
  .stdout
52
52
  ```
53
53
 
data/lib/test-cmd.rb CHANGED
@@ -22,21 +22,11 @@ class Test::Cmd
22
22
  @spawned = false
23
23
  end
24
24
 
25
- ##
26
- # @param [String, #to_s] arg
27
- # A command-line argument.
28
- # @return [Test::Cmd]
29
- def arg(arg)
30
- tap do
31
- @argv.push(arg)
32
- end
33
- end
34
-
35
25
  ##
36
26
  # @param [Array<String, #to_s>] argv
37
27
  # One or more command-line arguments.
38
28
  # @return [Test::Cmd]
39
- def args(*argv)
29
+ def argv(*argv)
40
30
  tap do
41
31
  @argv.concat(argv)
42
32
  end
@@ -54,4 +54,10 @@ class CmdTest < Test::Unit::TestCase
54
54
  assert_instance_of Enumerator,
55
55
  cmd("ruby", "-e", "puts 'FooBar'").each_line
56
56
  end
57
+
58
+ def test_cmd_with_argv
59
+ assert_equal "42\n", cmd("ruby")
60
+ .argv("-e", "warn 42")
61
+ .stderr
62
+ end
57
63
  end
data/test-cmd.rb.gemspec CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.authors = ["0x1eef"]
6
6
  gem.email = ["0x1eef@protonmail.com"]
7
7
  gem.homepage = "https://github.com/0x1eef/test-cmd.rb#readme"
8
- gem.version = "0.7.0"
8
+ gem.version = "0.8.0"
9
9
  gem.required_ruby_version = ">= 3.0"
10
10
  gem.licenses = ["0BSD"]
11
11
  gem.files = `git ls-files`.split($/)
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: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'