Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.11.0
...
head fork: rspec/rspec-core
compare: 2-6-maintenance
  • 9 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
2  Gemfile
@@ -11,7 +11,7 @@ source "http://rubygems.org"
end
### dev dependencies
-gem "rake", "~> 0.8"
+gem "rake", "~> 0.9"
gem "cucumber", "~> 0.10.2"
gem "aruba", "~> 0.3.6"
gem "rcov", "0.9.9", :platforms => :mri
View
15 Rakefile
@@ -23,21 +23,9 @@ require "rake/rdoctask"
require "rspec/core/rake_task"
require "rspec/core/version"
-cucumber_loaded = false
-
begin
require "cucumber/rake/task"
-
Cucumber::Rake::Task.new(:cucumber)
-
- class Cucumber::Rake::Task::ForkedCucumberRunner
- # When cucumber shells out, we still need it to run in the context of our
- # bundle.
- def run
- sh "bundle exec #{RUBY} " + args.join(" ")
- end
- end
- cucumber_loaded = true
rescue LoadError => e
puts "unable to load cucumber, some tasks unavailable"
task :cucumber do
@@ -52,7 +40,6 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
end
-
namespace :rcov do
task :cleanup do
rm_rf 'coverage.data'
@@ -64,7 +51,7 @@ namespace :rcov do
t.rcov_opts << %[--no-html --aggregate coverage.data]
end
- if cucumber_loaded
+ if defined?(Cucumber)
Cucumber::Rake::Task.new :cucumber do |t|
t.cucumber_opts = %w{--format progress}
t.rcov = true
View
9 features/Changelog.md
@@ -1,15 +1,12 @@
-### 2.6.3 / not released
+### 2.6.3 / 2011-05-24
-[full changelog](http://github.com/rspec/rspec-core/compare/v2.6.2...master)
-
-* Minor output enhancment
- * Add dump of shell commands to re-run failed examples
+[full changelog](http://github.com/rspec/rspec-core/compare/v2.6.2...v2.6.3)
* Bug fixes
* Explicitly convert exit code to integer, avoiding TypeError when return
value of run is IO object proxied by `DRb::DRbObject` (Julian Scheid)
* Clarify behavior of `--example` command line option
-
+ * Build using a rubygems-1.6.2 to avoid downstream yaml parsing error
### 2.6.2 / 2011-05-21
View
12 lib/rspec/core/formatters/base_formatter.rb
@@ -12,13 +12,6 @@ class BaseFormatter
attr_reader :example_count, :pending_count, :failure_count
attr_reader :failed_examples, :pending_examples
- def self.relative_path(line)
- line = line.sub(File.expand_path("."), ".")
- line = line.sub(/\A([^:]+:\d+)$/, '\\1')
- return nil if line == '-e:1'
- line
- end
-
def initialize(output)
@output = output || StringIO.new
@example_count = @pending_count = @failure_count = 0
@@ -120,7 +113,10 @@ def configuration
def backtrace_line(line)
return nil if configuration.cleaned_from_backtrace?(line)
- self.class.relative_path(line)
+ line = line.sub(File.expand_path("."), ".")
+ line = line.sub(/\A([^:]+:\d+)$/, '\\1')
+ return nil if line == '-e:1'
+ line
end
def read_failed_line(exception, example)
View
12 lib/rspec/core/formatters/base_text_formatter.rb
@@ -39,18 +39,6 @@ def dump_summary(duration, example_count, failure_count, pending_count)
dump_profile if profile_examples? && failure_count == 0
output.puts "\nFinished in #{format_seconds(duration)} seconds\n"
output.puts colorise_summary(summary_line(example_count, failure_count, pending_count))
- dump_commands_to_rerun_failed_examples
- end
-
- def dump_commands_to_rerun_failed_examples
- return if failed_examples.empty?
- output.puts
- output.puts("Failed examples:")
- output.puts
-
- failed_examples.each do |example|
- output.puts(red("rspec #{BaseFormatter::relative_path(example.location)}") + " " + grey("# #{example.full_description}"))
- end
end
def dump_profile
View
2  lib/rspec/core/version.rb
@@ -1,7 +1,7 @@
module RSpec # :nodoc:
module Core # :nodoc:
module Version # :nodoc:
- STRING = '2.6.3.beta1'
+ STRING = '2.6.3'
end
end
end
View
249 spec/rspec/core/formatters/base_text_formatter_spec.rb
@@ -1,112 +1,89 @@
require 'spec_helper'
require 'rspec/core/formatters/base_text_formatter'
-describe RSpec::Core::Formatters::BaseTextFormatter do
- let(:output) { StringIO.new }
- let(:formatter) { RSpec::Core::Formatters::BaseTextFormatter.new(output) }
+module RSpec::Core::Formatters
- describe "#summary_line" do
- it "with 0s outputs pluralized (excluding pending)" do
- formatter.summary_line(0,0,0).should eq("0 examples, 0 failures")
- end
+ describe BaseTextFormatter do
+ let(:output) { StringIO.new }
+ let(:formatter) { RSpec::Core::Formatters::BaseTextFormatter.new(output) }
- it "with 1s outputs singular (including pending)" do
- formatter.summary_line(1,1,1).should eq("1 example, 1 failure, 1 pending")
- end
+ describe "#summary_line" do
+ context "with 0s" do
+ it "outputs pluralized (excluding pending)" do
+ formatter.summary_line(0,0,0).should eq("0 examples, 0 failures")
+ end
+ end
- it "with 2s outputs pluralized (including pending)" do
- formatter.summary_line(2,2,2).should eq("2 examples, 2 failures, 2 pending")
- end
- end
+ context "with 1s" do
+ it "outputs singular (including pending)" do
+ formatter.summary_line(1,1,1).should eq("1 example, 1 failure, 1 pending")
+ end
+ end
- describe "#dump_commands_to_rerun_failed_examples" do
- it "includes command to re-run each failed example" do
- group = RSpec::Core::ExampleGroup.describe("example group") do
- it("fails") { fail }
+ context "with 2s" do
+ it "outputs pluralized (including pending)" do
+ formatter.summary_line(2,2,2).should eq("2 examples, 2 failures, 2 pending")
+ end
end
- line = __LINE__ - 2
- group.run(formatter)
- formatter.dump_commands_to_rerun_failed_examples
- output.string.should include("rspec #{RSpec::Core::Formatters::BaseFormatter::relative_path("#{__FILE__}:#{line}")} # example group fails")
end
- end
-
- describe "#dump_failures" do
- let(:group) { RSpec::Core::ExampleGroup.describe("group name") }
- before { RSpec.configuration.stub(:color_enabled?) { false } }
+ describe "#dump_failures" do
+ let(:group) { RSpec::Core::ExampleGroup.describe("group name") }
- def run_all_and_dump_failures
- group.run(formatter)
- formatter.dump_failures
- end
+ before { RSpec.configuration.stub(:color_enabled?) { false } }
- it "preserves formatting" do
- group.example("example name") { "this".should eq("that") }
+ def run_all_and_dump_failures
+ group.run(formatter)
+ formatter.dump_failures
+ end
- run_all_and_dump_failures
+ it "preserves formatting" do
+ group.example("example name") { "this".should eq("that") }
- output.string.should =~ /group name example name/m
- output.string.should =~ /(\s+)expected \"that\"\n\1 got \"this\"/m
- end
+ run_all_and_dump_failures
- context "with an exception without a message" do
- it "does not throw NoMethodError" do
- exception_without_message = Exception.new()
- exception_without_message.stub(:message) { nil }
- group.example("example name") { raise exception_without_message }
- expect { run_all_and_dump_failures }.not_to raise_error(NoMethodError)
+ output.string.should =~ /group name example name/m
+ output.string.should =~ /(\s+)expected \"that\"\n\1 got \"this\"/m
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') }
- run_all_and_dump_failures
- output.string.should =~ /NameError/m
+ context "with an exception without a message" do
+ it "does not throw NoMethodError" do
+ exception_without_message = Exception.new()
+ exception_without_message.stub(:message) { nil }
+ group.example("example name") { raise exception_without_message }
+ expect { run_all_and_dump_failures }.not_to raise_error(NoMethodError)
+ end
end
- end
- context "with a failed expectation (rspec-expectations)" do
- it "does not show the error class" do
- group.example("example name") { "this".should eq("that") }
- run_all_and_dump_failures
- output.string.should_not =~ /RSpec/m
+ 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') }
+ run_all_and_dump_failures
+ output.string.should =~ /NameError/m
+ end
end
- end
- context "with a failed message expectation (rspec-mocks)" do
- it "does not show the error class" do
- group.example("example name") { "this".should_receive("that") }
- run_all_and_dump_failures
- output.string.should_not =~ /RSpec/m
+ context "with a failed expectation (rspec-expectations)" do
+ it "does not show the error class" do
+ group.example("example name") { "this".should eq("that") }
+ run_all_and_dump_failures
+ output.string.should_not =~ /RSpec/m
+ end
end
- end
-
- context 'for #share_examples_for' do
- it 'outputs the name and location' do
- share_examples_for 'foo bar' do
- it("example name") { "this".should eq("that") }
+ context "with a failed message expectation (rspec-mocks)" do
+ it "does not show the error class" do
+ group.example("example name") { "this".should_receive("that") }
+ run_all_and_dump_failures
+ output.string.should_not =~ /RSpec/m
end
-
- line = __LINE__.next
- group.it_should_behave_like('foo bar')
-
- run_all_and_dump_failures
-
- output.string.should include(
- 'Shared Example Group: "foo bar" called from ' +
- "./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
- )
end
- context 'that contains nested example groups' do
+ context 'for #share_examples_for' do
it 'outputs the name and location' do
+
share_examples_for 'foo bar' do
- describe 'nested group' do
- it("example name") { "this".should eq("that") }
- end
+ it("example name") { "this".should eq("that") }
end
line = __LINE__.next
@@ -119,78 +96,98 @@ def run_all_and_dump_failures
"./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
)
end
- end
- end
- context 'for #share_as' do
- it 'outputs the name and location' do
-
- share_as :FooBar do
- it("example name") { "this".should eq("that") }
- end
+ context 'that contains nested example groups' do
+ it 'outputs the name and location' do
+ share_examples_for 'foo bar' do
+ describe 'nested group' do
+ it("example name") { "this".should eq("that") }
+ end
+ end
- line = __LINE__.next
- group.send(:include, FooBar)
+ line = __LINE__.next
+ group.it_should_behave_like('foo bar')
- run_all_and_dump_failures
+ run_all_and_dump_failures
- output.string.should include(
- 'Shared Example Group: "FooBar" called from ' +
- "./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
- )
+ output.string.should include(
+ 'Shared Example Group: "foo bar" called from ' +
+ "./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
+ )
+ end
+ end
end
- context 'that contains nested example groups' do
+ context 'for #share_as' do
it 'outputs the name and location' do
- share_as :NestedFoo do
- describe 'nested group' do
- describe 'hell' do
- it("example name") { "this".should eq("that") }
- end
- end
+ share_as :FooBar do
+ it("example name") { "this".should eq("that") }
end
line = __LINE__.next
- group.send(:include, NestedFoo)
+ group.send(:include, FooBar)
run_all_and_dump_failures
output.string.should include(
- 'Shared Example Group: "NestedFoo" called from ' +
+ 'Shared Example Group: "FooBar" called from ' +
"./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
)
end
+
+ context 'that contains nested example groups' do
+ it 'outputs the name and location' do
+
+ share_as :NestedFoo do
+ describe 'nested group' do
+ describe 'hell' do
+ it("example name") { "this".should eq("that") }
+ end
+ end
+ end
+
+ line = __LINE__.next
+ group.send(:include, NestedFoo)
+
+ run_all_and_dump_failures
+
+ output.string.should include(
+ 'Shared Example Group: "NestedFoo" called from ' +
+ "./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
+ )
+ end
+ end
end
end
- end
- describe "#dump_profile" do
- before do
- formatter.stub(:examples) do
- group = RSpec::Core::ExampleGroup.describe("group") do
- example("example")
+ describe "#dump_profile" do
+ before do
+ formatter.stub(:examples) do
+ group = RSpec::Core::ExampleGroup.describe("group") do
+ example("example")
+ end
+ group.run(double('reporter').as_null_object)
+ group.examples
end
- group.run(double('reporter').as_null_object)
- group.examples
end
- end
- it "names the example" do
- formatter.dump_profile
- output.string.should =~ /group example/m
- end
+ it "names the example" do
+ formatter.dump_profile
+ output.string.should =~ /group example/m
+ end
- it "prints the time" do
- formatter.dump_profile
- output.string.should =~ /0(\.\d+)? seconds/
- end
+ it "prints the time" do
+ formatter.dump_profile
+ output.string.should =~ /0(\.\d+)? seconds/
+ end
- it "prints the path" do
- formatter.dump_profile
- filename = __FILE__.split(File::SEPARATOR).last
+ it "prints the path" do
+ formatter.dump_profile
+ filename = __FILE__.split(File::SEPARATOR).last
- output.string.should =~ /#{filename}\:#{__LINE__ - 21}/
+ output.string.should =~ /#{filename}\:#{__LINE__ - 21}/
+ end
end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.