diff options
Diffstat (limited to 'spec/mspec/spec/helpers/mock_to_path_spec.rb')
-rw-r--r-- | spec/mspec/spec/helpers/mock_to_path_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/mspec/spec/helpers/mock_to_path_spec.rb b/spec/mspec/spec/helpers/mock_to_path_spec.rb new file mode 100644 index 0000000000..464e7e5440 --- /dev/null +++ b/spec/mspec/spec/helpers/mock_to_path_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' +require 'mspec/guards' +require 'mspec/helpers' + +describe Object, "#mock_to_path" do + it "returns an object that responds to #to_path" do + obj = mock_to_path("foo") + obj.should be_a(MockObject) + obj.should respond_to(:to_path) + obj.to_path + end + + it "returns the provided path when #to_path is called" do + obj = mock_to_path("/tmp/foo") + obj.to_path.should == "/tmp/foo" + end +end |