【发布时间】:2013-12-04 06:37:22
【问题描述】:
我正在为 Githug gem 写一个关卡,这是一个教 github 的游戏 https://github.com/Gazler/githug
我分叉/克隆了 repo 并创建了一个名为“delete_branch”的级别:
difficulty 2
description "You have created too many branches for your project. There is an old branch in your repo called 'delete_me', you should delete it."
setup do
repo.init
FileUtils.touch("README")
repo.add "README"
repo.commit_all("Initial commit")
repo.git.native :checkout, {"b" => true}, 'delete_me'
repo.git.native :checkout, {}, 'master'
end
solution do
return true unless repo.branches.map(&:name).include?('delete_me')
end
hint do
puts "Running 'git --help branch' will give you a list of branch commands."
end
我无法弄清楚如何对其进行测试,并且很难在我的本地计算机上运行关卡。这是我的分叉仓库的链接:
https://github.com/smilansky/githug
这是我的第一个开源贡献,任何帮助将不胜感激。
【问题讨论】:
标签: ruby github open-source gem