Permalink
Browse files

Entry#rename returns the renamed entry

  • Loading branch information...
1 parent c27d16e commit 2b622ba94c86ede10253e0e319682d87c5a4e0e4 @adamwiggins committed Mar 25, 2009
Showing with 5 additions and 0 deletions.
  1. +1 −0 lib/rush/entry.rb
  2. +4 −0 spec/entry_spec.rb
View
@@ -88,6 +88,7 @@ class NameCannotContainSlash < Exception; end
def rename(new_name)
connection.rename(@path, @name, new_name)
@name = new_name
+ self
end
# Rename an entry to another name within the same dir. The existing object
View
@@ -56,6 +56,10 @@
File.exists?("#{@sandbox_dir}/#{new_file}").should be_true
end
+ it "rename returns the renamed file" do
+ @entry.rename('file2').should == @entry.parent['file2']
+ end
+
it "can't rename itself if another file already exists with that name" do
new_file = "test3"
system "touch #{@sandbox_dir}/#{new_file}"

0 comments on commit 2b622ba

Please sign in to comment.