[macruby-changes] [2490] MacRuby/trunk/mspec
source_changes at macosforge.org
source_changes at macosforge.org
Sat Sep 5 09:27:36 PDT 2009
Revision: 2490
http://trac.macosforge.org/projects/ruby/changeset/2490
Author: eloy.de.enige at gmail.com
Date: 2009-09-05 09:27:36 -0700 (Sat, 05 Sep 2009)
Log Message:
-----------
Updated MSpec to a719211ff32b725b9e9568cf887868849e73d796
Modified Paths:
--------------
MacRuby/trunk/mspec/lib/mspec/helpers.rb
MacRuby/trunk/mspec/upstream
Added Paths:
-----------
MacRuby/trunk/mspec/lib/mspec/helpers/mock_to_path.rb
MacRuby/trunk/mspec/spec/helpers/mock_to_path_spec.rb
Added: MacRuby/trunk/mspec/lib/mspec/helpers/mock_to_path.rb
===================================================================
--- MacRuby/trunk/mspec/lib/mspec/helpers/mock_to_path.rb (rev 0)
+++ MacRuby/trunk/mspec/lib/mspec/helpers/mock_to_path.rb 2009-09-05 16:27:36 UTC (rev 2490)
@@ -0,0 +1,7 @@
+class Object
+ def mock_to_path(path)
+ obj = mock('path')
+ obj.should_receive(:to_path).and_return(path)
+ obj
+ end
+end
Modified: MacRuby/trunk/mspec/lib/mspec/helpers.rb
===================================================================
--- MacRuby/trunk/mspec/lib/mspec/helpers.rb 2009-09-05 16:27:23 UTC (rev 2489)
+++ MacRuby/trunk/mspec/lib/mspec/helpers.rb 2009-09-05 16:27:36 UTC (rev 2490)
@@ -11,6 +11,7 @@
require 'mspec/helpers/io'
require 'mspec/helpers/language_version'
require 'mspec/helpers/metaclass'
+require 'mspec/helpers/mock_to_path'
require 'mspec/helpers/nan'
require 'mspec/helpers/ruby_exe'
require 'mspec/helpers/scratch'
Added: MacRuby/trunk/mspec/spec/helpers/mock_to_path_spec.rb
===================================================================
--- MacRuby/trunk/mspec/spec/helpers/mock_to_path_spec.rb (rev 0)
+++ MacRuby/trunk/mspec/spec/helpers/mock_to_path_spec.rb 2009-09-05 16:27:36 UTC (rev 2490)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require 'mspec/helpers/mock_to_path'
+
+describe Object, "#mock_to_path" do
+ it "returns an object that responds to #to_path" do
+ obj = mock_to_path("foo")
+ 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
Modified: MacRuby/trunk/mspec/upstream
===================================================================
--- MacRuby/trunk/mspec/upstream 2009-09-05 16:27:23 UTC (rev 2489)
+++ MacRuby/trunk/mspec/upstream 2009-09-05 16:27:36 UTC (rev 2490)
@@ -1 +1 @@
-ef4487f3cab0f9ce30c37e43cf9641c6ff791162
\ No newline at end of file
+a719211ff32b725b9e9568cf887868849e73d796
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090905/5c4d58ef/attachment.html>
More information about the macruby-changes
mailing list