Skip to content

Commit 2fcf8b1

Browse files
author
Dusty
committed
adding spec helper for commands
1 parent 5d48c3d commit 2fcf8b1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

spec/spec_helper/command.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
# spec/spec_helper/command.rb
3+
4+
module SpecHelper
5+
module Command
6+
def argv(*argv)
7+
CLAide::ARGV.new(argv)
8+
end
9+
10+
def command(*argv)
11+
argv << '--no-ansi'
12+
Pod::Command.parse(argv)
13+
end
14+
15+
def run_command(*args)
16+
Dir.chdir(SpecHelper.temporary_directory) do
17+
Pod::UI.output = ''
18+
# @todo Remove this once all cocoapods has
19+
# been converted to use the UI.puts
20+
config_silent = config.silent?
21+
config.silent = false
22+
cmd = command(*args)
23+
cmd.validate!
24+
cmd.run
25+
config.silent = config_silent
26+
Pod::UI.output
27+
end
28+
end
29+
end
30+
end

0 commit comments

Comments
 (0)