cli!(*args)
click to toggle source
def cli!(*args)
@shell = FakeShell.new
@exit_status = Dir.chdir(pwd) do
described_class.with_environment do
described_class.returning_status do
described_class.start args, :shell => @shell
end
end
end
end
exit_status()
click to toggle source
def exit_status
@exit_status
end
have_file(rel_path, content = nil)
click to toggle source
def have_file(rel_path, content = nil)
FileMatcher.new(rel_path, content)
end
have_json_file(rel_path, content)
click to toggle source
def have_json_file(rel_path, content)
FileMatcher.new(rel_path, content, :type => :json)
end
shell()
click to toggle source
stderr()
click to toggle source
def stderr
shell.stderr.string
end
stdout()
click to toggle source
def stdout
shell.stdout.string
end
strip_heredoc(text)
click to toggle source
def strip_heredoc(text)
Librarian::Helpers.strip_heredoc(text)
end
write_file!(path, content)
click to toggle source
def write_file!(path, content)
path = pwd.join(path)
path.dirname.mkpath
path.open("wb"){|f| f.write(content)}
end
write_json_file!(path, content)
click to toggle source
def write_json_file!(path, content)
write_file! path, JSON.dump(content)
end