Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a spec for File#identical? in 1.8 mode for non-String arguments

  • Loading branch information...
commit 075cb508209a88f1b311e2f27b16896e1afd3789 1 parent 0672a14
@eregon authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 spec/ruby/shared/file/identical.rb
View
10 spec/ruby/shared/file/identical.rb
@@ -26,13 +26,21 @@
@object.send(@method, @non_exist, @non_exist).should be_false
end
+ ruby_version_is ""..."1.9" do
+ it "accepts an object that has a #to_str method" do
+ file1, link = mock('file1'), mock('link')
+ file1.should_receive(:to_str).and_return(@file1)
+ link.should_receive(:to_str).and_return(@link)
+ @object.send(@method, file1, link).should == true
+ end
+ end
+
ruby_version_is "1.9" do
it "accepts an object that has a #to_path method" do
@object.send(@method, mock_to_path(@file1), mock_to_path(@link)).should == true
end
end
-
it "raises an ArgumentError if not passed two arguments" do
lambda { @object.send(@method, @file1, @file2, @link) }.should raise_error(ArgumentError)
lambda { @object.send(@method, @file1) }.should raise_error(ArgumentError)
Please sign in to comment.
Something went wrong with that request. Please try again.