Skip to content

Commit

Permalink
added rename level
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrodrigues committed Mar 16, 2012
1 parent cf34f08 commit 6f6065b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions levels/rename.rb
@@ -0,0 +1,16 @@
difficulty 3

description "We have a file called oldFile.txt. We want to rename it to newFile.txt and stage this change."

setup do
repo.init
FileUtils.touch("oldFile.txt")
end

solution do
repo.status["oldFile.txt"].type == "D" && repo.status["newFile.txt"].type == "A" && repo.status["oldFile.txt"].stage.nil?
end

hint do
puts "Take a look at `git mv`"
end
2 changes: 1 addition & 1 deletion lib/githug/level.rb
Expand Up @@ -6,7 +6,7 @@ class Level
"clone_to_folder", "ignore", "status", "rm", "rm_cached", "log",
"commit_ammend", "reset", "checkout_file", "remote", "remote_url",
"remote_add", "diff", "blame", "branch", "checkout", "merge",
"contribute"]
"rename", "contribute"]

attr_accessor :level_no, :level_path

Expand Down

0 comments on commit 6f6065b

Please sign in to comment.