Skip to content

Comparing changes

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

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 17 commits
  • 16 files changed
  • 0 commit comments
  • 2 contributors
Commits on May 21, 2011
Julian Scheid Explicitly convert exit code to integer, avoiding TypeError when retu…
…rn value of run is IO object proxied by DRb::DRbObject
0998854
@dchelimsky dchelimsky Merge pull request #382 from jscheid/master
Convert value returned by DRb to integer
c4427b7
@dchelimsky dchelimsky changelog 5554b70
@dchelimsky dchelimsky Add dump of shell commands to re-run failed examples (inspired by
Cucumber).
de6531b
@dchelimsky dchelimsky Clarify behavior of --example command line option
- Closes #378.
- Also see #299.
54f90b3
Commits on May 22, 2011
@dchelimsky dchelimsky bump to 2.6.3.beta1 to see if building in older rubygems fixes issue
with differences in yaml date emitting and parsing
80bf3a3
@dchelimsky dchelimsky changes 1f93c36
Commits on May 23, 2011
@dchelimsky dchelimsky clean up the expectation framework configuration cd5bbec
@dchelimsky dchelimsky add feature with RSpec::TestCase and test_ methods cea5d2f
@dchelimsky dchelimsky move example group subclassing to inherited hook to support defining …
…an example group with a class declaration
fcd564e
@dchelimsky dchelimsky add support for defining examples using def test_xxx d523321
@dchelimsky dchelimsky strip Test, Spec, or Describe from class name c1b2b00
@dchelimsky dchelimsky configure stdlib in feature
- we'll make rspec + stdlib the default in rspec-3, but automatically
  including stdlib would be a potentially breaking change in rspec-2
450a3b1
@dchelimsky dchelimsky remove accidental file 1c771dd
@dchelimsky dchelimsky dev: remove unnecessary monkey patch of Cucumber 7e34411
@dchelimsky dchelimsky ci: bundle exec rake (to ensure compatibility w/ downstream deps) b13d0f1
@dchelimsky dchelimsky Merge branch 'master' into classes_and_methods
* master:
  ci: bundle exec rake (to ensure compatibility w/ downstream deps)
  dev: remove unnecessary monkey patch of Cucumber
  remove accidental file
d51eb83
View
2 .travis.yml
@@ -1,4 +1,4 @@
-script: "rake"
+script: "bundle exec rake"
rvm:
- 1.8.6
- 1.8.7
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
13 features/Changelog.md
@@ -1,3 +1,16 @@
+### 2.6.3 / not released
+
+[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
+
+* 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
+
+
### 2.6.2 / 2011-05-21
[full changelog](http://github.com/rspec/rspec-core/compare/v2.6.1...v2.6.2)
View
27 features/example_groups/classes_and_methods.feature
@@ -0,0 +1,27 @@
+Feature: define example groups with classes and methods
+
+ You can use familiar constructs like Ruby classes and methods if you prefer
+ them over the `describe`/`it` DSL.
+
+ To get test/unit or minitest assertions you need to configure RSpec as shown
+ in the following scenario:
+
+ Scenario: declare example group by subclassing RSpec::ExampleGroup
+ Given a file named "array_spec.rb" with:
+ """
+ RSpec.configure {|c| c.expect_with :stdlib}
+
+ class ArrayTest < RSpec::TestCase
+ def test_is_empty_when_created
+ assert Array.new.empty?
+ end
+ end
+ """
+ When I run `rspec array_spec.rb --format doc`
+ Then the output should contain:
+ """
+ Array
+ is_empty_when_created
+ """
+ And the examples should all pass
+
View
2 lib/rspec/core.rb
@@ -31,6 +31,8 @@
module RSpec
autoload :Matchers, 'rspec/matchers'
+ ExampleGroup = Core::ExampleGroup
+ TestCase = Core::ExampleGroup
SharedContext = Core::SharedContext
module Core
View
52 lib/rspec/core/configuration.rb
@@ -37,7 +37,8 @@ def self.add_setting(name, opts={})
add_setting :backtrace_clean_patterns
add_setting :tty
add_setting :treat_symbols_as_metadata_keys_with_true_values, :default => false
- add_setting :expecting_with_rspec
+ add_setting :expectation_frameworks
+
CONDITIONAL_FILTERS = {
:if => lambda { |value, metadata| metadata.has_key?(:if) && !value },
@@ -52,12 +53,15 @@ def self.add_setting(name, opts={})
/lib\/rspec\/(core|expectations|matchers|mocks)/
]
+ DEFAULT_EXPECTATION_FRAMEWORKS = [:rspec]
+
def initialize
@color_enabled = false
self.include_or_extend_modules = []
self.files_to_run = []
self.backtrace_clean_patterns = DEFAULT_BACKTRACE_PATTERNS.dup
self.exclusion_filter = CONDITIONAL_FILTERS.dup
+ self.expectation_frameworks = DEFAULT_EXPECTATION_FRAMEWORKS.dup
end
def reset
@@ -179,43 +183,24 @@ def mock_framework=(framework)
end
end
- # Returns the configured expectation framework adapter module(s)
- def expectation_frameworks
- expect_with :rspec unless settings[:expectation_frameworks]
- settings[:expectation_frameworks]
- end
-
- # Delegates to expect_with([framework])
- def expectation_framework=(framework)
- expect_with([framework])
- end
-
# Sets the expectation framework module(s).
#
- # +frameworks+ can be :rspec, :stdlib, or both
+ # +frameworks+ can be :rspec, :stdlib, or both
#
# Given :rspec, configures rspec/expectations.
# Given :stdlib, configures test/unit/assertions
# Given both, configures both
def expect_with(*frameworks)
- settings[:expectation_frameworks] = []
+ expectation_frameworks.clear
frameworks.each do |framework|
- case framework
- when Symbol
- case framework
- when :rspec
- require 'rspec/core/expecting/with_rspec'
- self.expecting_with_rspec = true
- when :stdlib
- require 'rspec/core/expecting/with_stdlib'
- else
- raise ArgumentError, "#{framework.inspect} is not supported"
- end
- settings[:expectation_frameworks] << RSpec::Core::ExpectationFrameworkAdapter
- end
+ settings[:expectation_frameworks] << framework
end
end
+ def expecting_with_rspec?
+ expectation_frameworks.include?(:rspec)
+ end
+
def full_backtrace=(true_or_false)
settings[:backtrace_clean_patterns] = true_or_false ? [] : DEFAULT_BACKTRACE_PATTERNS
end
@@ -360,6 +345,7 @@ def inclusion_filter=(filter)
def inclusion_filter
settings[:inclusion_filter] || {}
end
+
def filter_run_including(*args)
force_overwrite = if args.last.is_a?(Hash) || args.last.is_a?(Symbol)
false
@@ -411,7 +397,17 @@ def configure_mock_framework
def configure_expectation_framework
expectation_frameworks.each do |framework|
- RSpec::Core::ExampleGroup.send(:include, framework)
+ case framework
+ when :rspec
+ require 'rspec/core/expecting/with_rspec'
+ when :stdlib
+ require 'rspec/core/expecting/with_stdlib'
+ else
+ raise ArgumentError, "#{framework.inspect} is not supported"
+ end
+ end
+ unless expectation_frameworks.empty?
+ RSpec::Core::ExampleGroup.send(:include, RSpec::Core::ExpectationFrameworkAdapter)
end
end
View
39 lib/rspec/core/example_group.rb
@@ -118,29 +118,22 @@ def self.superclass_metadata
end
def self.describe(*args, &example_group_block)
- @_subclass_count ||= 0
- @_subclass_count += 1
- args << {} unless args.last.is_a?(Hash)
- args.last.update(:example_group_block => example_group_block)
-
- # TODO 2010-05-05: Because we don't know if const_set is thread-safe
- child = const_set(
- "Nested_#{@_subclass_count}",
- subclass(self, args, &example_group_block)
- )
- children << child
+ $initialization_args = args
+ child = Class.new(self)
+ child.module_eval(&example_group_block) if example_group_block
child
+ ensure
+ $initialization_args = nil
end
- class << self
- alias_method :context, :describe
+ def self.inherited(child)
+ child.register if child.top_level?
+ child.set_it_up(*$initialization_args || [subject_for(child.name)])
+ children << child
end
- def self.subclass(parent, args, &example_group_block)
- subclass = Class.new(parent)
- subclass.set_it_up(*args)
- subclass.module_eval(&example_group_block) if example_group_block
- subclass
+ class << self
+ alias_method :context, :describe
end
def self.children
@@ -315,6 +308,16 @@ def self.set_ivars(instance, ivars)
ivars.each {|name, value| instance.instance_variable_set(name, value)}
end
+ def self.method_added(m)
+ if m.to_s =~ /test_(.*)/
+ example($1) { method(m).call }
+ end
+ end
+
+ def self.subject_for(name)
+ name.gsub(/(^Describe|Spec|Test)/,'')
+ end
+
def described_class
self.class.described_class
end
View
2 lib/rspec/core/extensions/object.rb
@@ -2,7 +2,7 @@ module RSpec
module Core
module ObjectExtensions
def describe(*args, &example_group_block)
- RSpec::Core::ExampleGroup.describe(*args, &example_group_block).register
+ RSpec::Core::ExampleGroup.describe(*args, &example_group_block)
end
end
end
View
12 lib/rspec/core/formatters/base_formatter.rb
@@ -12,6 +12,13 @@ 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
@@ -113,10 +120,7 @@ def configuration
def backtrace_line(line)
return nil if configuration.cleaned_from_backtrace?(line)
- line = line.sub(File.expand_path("."), ".")
- line = line.sub(/\A([^:]+:\d+)$/, '\\1')
- return nil if line == '-e:1'
- line
+ self.class.relative_path(line)
end
def read_failed_line(exception, example)
View
12 lib/rspec/core/formatters/base_text_formatter.rb
@@ -39,6 +39,18 @@ 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
3 lib/rspec/core/option_parser.rb
@@ -40,8 +40,7 @@ def parser(options)
options[:debug] = true
end
- parser.on('-e', '--example PATTERN', "Run examples whose full descriptions match this pattern",
- "(PATTERN is compiled into a Ruby regular expression)") do |o|
+ parser.on('-e', '--example STRING', "Run examples whose full nested names include STRING") do |o|
options[:full_description] = Regexp.compile(Regexp.escape(o))
end
View
2 lib/rspec/core/runner.rb
@@ -8,7 +8,7 @@ class Runner
def self.autorun
return if autorun_disabled? || installed_at_exit? || running_in_drb?
@installed_at_exit = true
- at_exit { exit(run(ARGV, $stderr, $stdout)) }
+ at_exit { exit(run(ARGV, $stderr, $stdout).to_i) }
end
AT_EXIT_HOOK_BACKTRACE_LINE = "#{__FILE__}:#{__LINE__ - 2}:in `autorun'"
View
2 lib/rspec/core/version.rb
@@ -1,7 +1,7 @@
module RSpec # :nodoc:
module Core # :nodoc:
module Version # :nodoc:
- STRING = '2.6.2'
+ STRING = '2.6.3.beta1'
end
end
end
View
18 spec/rspec/core/configuration_spec.rb
@@ -82,31 +82,27 @@ module RSpec::Core
describe "#expectation_framework" do
it "defaults to :rspec" do
+ config.expectation_frameworks = [:rspec]
config.should_receive(:require).with('rspec/core/expecting/with_rspec')
- config.expectation_frameworks
- end
- end
-
- describe "#expectation_framework=" do
- it "delegates to expect_with=" do
- config.should_receive(:expect_with).with([:rspec])
- config.expectation_framework = :rspec
+ config.configure_expectation_framework
end
end
describe "#expect_with" do
[:rspec, :stdlib].each do |framework|
context "with #{framework}" do
it "requires the adapter for #{framework.inspect}" do
- config.should_receive(:require).with("rspec/core/expecting/with_#{framework}")
config.expect_with framework
+ config.should_receive(:require).with("rspec/core/expecting/with_#{framework}")
+ config.configure_expectation_framework
end
end
end
it "raises ArgumentError if framework is not supported" do
expect do
config.expect_with :not_supported
+ config.configure_expectation_framework
end.to raise_error(ArgumentError)
end
end
@@ -118,8 +114,8 @@ module RSpec::Core
config.stub(:require)
end
- it "returns false by default" do
- config.should_not be_expecting_with_rspec
+ it "returns true by default" do
+ config.should be_expecting_with_rspec
end
it "returns true when `expect_with :rspec` has been configured" do
View
23 spec/rspec/core/example_group_spec.rb
@@ -906,5 +906,28 @@ def foo; 'foo'; end
end
end
+ describe "a method starting with test_" do
+ it "is generates an an example" do
+ group = ExampleGroup.describe do
+ def test_something_that_fails
+ 1.should eq(2)
+ end
+ end
+
+ group.examples.length.should eq(1)
+ group.examples.first.description.should eq('something_that_fails')
+ group.run.should be_false, "expected a failure"
+ end
+ end
+
+ describe "#subject_for" do
+ it "removes Test or Spec, or Describe from the name" do
+ group = ExampleGroup.describe
+ group.subject_for('FooTest').should eq('Foo')
+ group.subject_for('FooSpec').should eq('Foo')
+ group.subject_for('DescribeFoo').should eq('Foo')
+ end
+ end
+
end
end
View
249 spec/rspec/core/formatters/base_text_formatter_spec.rb
@@ -1,89 +1,112 @@
require 'spec_helper'
require 'rspec/core/formatters/base_text_formatter'
-module RSpec::Core::Formatters
+describe RSpec::Core::Formatters::BaseTextFormatter do
+ let(:output) { StringIO.new }
+ let(:formatter) { RSpec::Core::Formatters::BaseTextFormatter.new(output) }
- describe BaseTextFormatter do
- let(:output) { StringIO.new }
- let(:formatter) { RSpec::Core::Formatters::BaseTextFormatter.new(output) }
+ 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 "#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 1s outputs singular (including pending)" do
+ formatter.summary_line(1,1,1).should eq("1 example, 1 failure, 1 pending")
+ 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
+ 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 2s" do
- it "outputs pluralized (including pending)" do
- formatter.summary_line(2,2,2).should eq("2 examples, 2 failures, 2 pending")
- 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 }
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") }
+ describe "#dump_failures" do
+ let(:group) { RSpec::Core::ExampleGroup.describe("group name") }
- before { RSpec.configuration.stub(:color_enabled?) { false } }
+ before { RSpec.configuration.stub(:color_enabled?) { false } }
- def run_all_and_dump_failures
- group.run(formatter)
- formatter.dump_failures
- end
+ def run_all_and_dump_failures
+ group.run(formatter)
+ formatter.dump_failures
+ end
- it "preserves formatting" do
- group.example("example name") { "this".should eq("that") }
+ it "preserves formatting" do
+ group.example("example name") { "this".should eq("that") }
- run_all_and_dump_failures
+ run_all_and_dump_failures
+
+ output.string.should =~ /group name example name/m
+ output.string.should =~ /(\s+)expected \"that\"\n\1 got \"this\"/m
+ end
- output.string.should =~ /group name example name/m
- output.string.should =~ /(\s+)expected \"that\"\n\1 got \"this\"/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
- 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
+ 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
- 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
+ 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
- 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
+ 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
+ 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 '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") }
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 'for #share_examples_for' do
+ context 'that contains nested example groups' do
it 'outputs the name and location' do
-
share_examples_for 'foo bar' do
- it("example name") { "this".should eq("that") }
+ describe 'nested group' do
+ it("example name") { "this".should eq("that") }
+ end
end
line = __LINE__.next
@@ -96,98 +119,78 @@ def run_all_and_dump_failures
"./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
)
end
+ end
+ 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
+ context 'for #share_as' do
+ it 'outputs the name and location' do
- line = __LINE__.next
- group.it_should_behave_like('foo bar')
+ share_as :FooBar do
+ it("example name") { "this".should eq("that") }
+ end
- run_all_and_dump_failures
+ line = __LINE__.next
+ group.send(:include, FooBar)
- output.string.should include(
- 'Shared Example Group: "foo bar" called from ' +
- "./spec/rspec/core/formatters/base_text_formatter_spec.rb:#{line}"
- )
- end
- end
+ 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}"
+ )
end
- context 'for #share_as' do
+ context 'that contains nested example groups' do
it 'outputs the name and location' do
- share_as :FooBar do
- it("example name") { "this".should eq("that") }
+ 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, FooBar)
+ group.send(:include, NestedFoo)
run_all_and_dump_failures
output.string.should include(
- 'Shared Example Group: "FooBar" called from ' +
+ 'Shared Example Group: "NestedFoo" 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")
- end
- group.run(double('reporter').as_null_object)
- group.examples
+ 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
+ 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}/
- end
+ output.string.should =~ /#{filename}\:#{__LINE__ - 21}/
end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.