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-core
base: v2.10.0
...
head fork: rspec/rspec-core
compare: v2.10.1
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
9 Changelog.md
@@ -1,3 +1,12 @@
+### 2.10.1 / 2012-05-19
+[full changelog](http://github.com/rspec/rspec-core/compare/v2.10.0...v2.10.1)
+
+Bug fixes
+
+* `RSpec.reset` properly reinits configuration and world
+* Call `to_s` before `split` on exception messages that might not always be
+ Strings (slyphon)
+
### 2.10.0 / 2012-05-03
[full changelog](http://github.com/rspec/rspec-core/compare/v2.9.0...v2.10.0)
View
4 lib/rspec/core.rb
@@ -66,8 +66,8 @@ def self.world
# Used internally to ensure examples get reloaded between multiple runs in
# the same process.
def self.reset
- world.reset
- configuration.reset
+ @world = nil
+ @configuration = nil
end
# Returns the global [Configuration](RSpec/Core/Configuration) object. While you
View
2  lib/rspec/core/formatters/base_text_formatter.rb
@@ -179,7 +179,7 @@ def dump_failure_info(example)
exception = example.execution_result[:exception]
output.puts "#{long_padding}#{red("Failure/Error:")} #{red(read_failed_line(exception, example).strip)}"
output.puts "#{long_padding}#{red(exception.class.name << ":")}" unless exception.class.name =~ /RSpec/
- exception.message.split("\n").each { |line| output.puts "#{long_padding} #{red(line)}" } if exception.message
+ exception.message.to_s.split("\n").each { |line| output.puts "#{long_padding} #{red(line)}" } if exception.message
if shared_group = find_shared_group(example)
dump_shared_failure_info(shared_group)
end
View
2  lib/rspec/core/version.rb
@@ -1,7 +1,7 @@
module RSpec
module Core
module Version
- STRING = '2.10.0'
+ STRING = '2.10.1'
end
end
end
View
9 spec/rspec/core/formatters/base_text_formatter_spec.rb
@@ -65,6 +65,15 @@ def run_all_and_dump_failures
end
end
+ context "with an exception that has an exception instance as its message" do
+ it "should not raise NoMethodError" do
+ gonzo_exception = RuntimeError.new
+ gonzo_exception.stub(:message) { gonzo_exception }
+ group.example("example name") { raise gonzo_exception }
+ expect { run_all_and_dump_failures }.not_to raise_error(NoMethodError)
+ end
+ end
+
context "with an exception class other than RSpec" do
it "does not show the error class" do
group.example("example name") { raise NameError.new('foo') }
View
7 spec/rspec/core/runner_spec.rb
@@ -25,10 +25,9 @@ module RSpec::Core
let(:err) { StringIO.new }
let(:out) { StringIO.new }
- it "resets world and configuration" do
- RSpec.configuration.stub(:files_to_run) { [] }
- RSpec.configuration.should_receive(:reset)
- RSpec.world.should_receive(:reset)
+ it "tells RSpec to reset" do
+ RSpec.configuration.stub(:files_to_run => [])
+ RSpec.should_receive(:reset)
RSpec::Core::Runner.run([], err, out)
end

No commit comments for this range

Something went wrong with that request. Please try again.