Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rspec/rspec-mocks
...
head fork: rspec/rspec-mocks
Checking mergeability… Don't worry, you can still create the pull request.
  • 11 commits
  • 10 files changed
  • 0 commit comments
  • 2 contributors
View
11 Gemfile
@@ -1,12 +1,13 @@
source "http://rubygems.org"
+%w[rspec-core rspec-expectations rspec-mocks].each do |lib|
+ gem lib, :path => File.expand_path("../../#{lib}", __FILE__)
+end
+
gem "rake"
-gem "cucumber"
-gem "aruba", ">= 0.2.0"
+gem "cucumber", "0.8.5"
+gem "aruba", "0.2.2"
gem "autotest"
-gem "rspec-mocks", :path => "."
-gem "rspec-core", :path => "../rspec-core"
-gem "rspec-expectations", :path => "../rspec-expectations"
gem "relish"
case RUBY_VERSION.to_s
View
7 History.markdown
@@ -1,5 +1,12 @@
## rspec-mocks release history (incomplete)
+### 2.0.1 / 2010-10-18
+
+[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.0...v2.0.1)
+
+* Enhancements
+ * Make dependencies on other rspec gems consistent across gems
+
### 2.0.0 / 2010-10-10
[full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.0.beta.22...v2.0.0)
View
10 README.markdown
@@ -3,11 +3,15 @@
rspec-mocks provides a test-double framework for rspec including support
for method stubs, fakes, and message expectations.
-## Install
+## Documentation
+
+* [Cucumber features](http://relishapp.com/rspec/rspec-mocks/v/2-0)
+* [RDoc](http://rubydoc.info/gems/rspec-mocks/2.0.1/frames)
- gem install rspec --prerelease
+## Install
-This will install rspec, rspec-core, rspec-expectations and rspec-mocks.
+ gem install rspec # for rspec-core, rspec-expectations, rspec-mocks
+ gem install rspec-mocks # for rspec-mocks only
## Method Stubs
View
2  Rakefile
@@ -64,7 +64,7 @@ end
desc "Push cukes to relishapp using the relish-client-gem"
task :relish, :version do |t, args|
raise "rake relish[VERSION]" unless args[:version]
- sh "bundle exec relish --organization rspec --project rspec-mocks -v #{args[:version]} push"
+ sh "relish push --organization rspec --project rspec-mocks -v #{args[:version]}"
end
task :default => [:spec, :cucumber]
View
25 lib/rspec/mocks/extensions/marshal.rb
@@ -0,0 +1,25 @@
+module Marshal
+
+ class << self
+
+ def dump_with_mocks(*args)
+ object = args.shift
+ return dump_without_mocks(*args.unshift(object)) unless object.instance_variable_defined?(:@mock_proxy)
+
+ mp = object.instance_variable_get(:@mock_proxy)
+ object.send(:remove_instance_variable, :@mock_proxy)
+
+ begin
+ dump_without_mocks(*args.unshift(object.dup))
+ ensure
+ object.instance_variable_set(:@mock_proxy,mp)
+ end
+ end
+
+ alias_method :dump_without_mocks, :dump
+ undef_method :dump
+ alias_method :dump, :dump_with_mocks
+
+ end
+
+end
View
2  lib/rspec/mocks/serialization.rb
@@ -1,3 +1,5 @@
+require 'rspec/mocks/extensions/marshal'
+
module RSpec
module Mocks
module Serialization
View
2  lib/rspec/mocks/version.rb
@@ -1,7 +1,7 @@
module RSpec # :nodoc:
module Mocks # :nodoc:
module Version # :nodoc:
- STRING = '2.0.0'
+ STRING = '2.0.2.pre'
end
end
end
View
4 rspec-mocks.gemspec
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.require_path = "lib"
- s.add_dependency "rspec-core", RSpec::Mocks::Version::STRING
- s.add_dependency "rspec-expectations", RSpec::Mocks::Version::STRING
+ s.add_dependency "rspec-core", "~> 2.0.2.pre"
+ s.add_dependency "rspec-expectations", "~> 2.0.2.pre"
end
View
29 spec/rspec/mocks/bug_report_15719_spec.rb
@@ -1,29 +0,0 @@
-require 'spec_helper'
-
-module RSpec
- module Mocks
- describe "mock failure" do
-
- it "tells you when it receives the right message with the wrong args" do
- double = double("foo")
- double.should_receive(:bar).with("message")
- lambda {
- double.bar("different message")
- }.should raise_error(RSpec::Mocks::MockExpectationError, %Q{Double "foo" received :bar with unexpected arguments\n expected: ("message")\n got: ("different message")})
- double.rspec_reset # so the example doesn't fail
- end
-
- pending "tells you when it receives the right message with the wrong args if you stub the method (fix bug 15719)" do
- # NOTE - for whatever reason, if you use a the block style of pending here,
- # rcov gets unhappy. Don't know why yet.
- double = double("foo")
- double.stub(:bar)
- double.should_receive(:bar).with("message")
- lambda {
- double.bar("different message")
- }.should raise_error(RSpec::Mocks::MockExpectationError, %Q{Double 'foo' expected :bar with ("message") but received it with ("different message")})
- double.rspec_reset # so the example doesn't fail
- end
- end
- end
-end
View
4 spec/rspec/mocks/serialization_spec.rb
@@ -60,9 +60,7 @@ def set_stub
end
it 'marshals the same with and without stubbing' do
- pending("not sure how to fix this yet") do
- expect { set_stub }.to_not change { Marshal.dump(subject) }
- end
+ expect { set_stub }.to_not change { Marshal.dump(subject) }
end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.