Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove Configuration#cleaned_from_backtrace?

We now use config.backtrace_cleaner.exclude?

Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information...
commit 659c23a866c81fc9f4bdaf990bc4dbf0dd2376fa 1 parent ffe7c1f
@samphippen authored
View
9 lib/rspec/core/configuration.rb
@@ -284,15 +284,6 @@ def add_setting(name, opts={})
send("#{name}=", default) if default
end
- # Used by formatters to ask whether a backtrace line should be displayed
- # or not, based on the line matching any `backtrace_clean_patterns`.
- def cleaned_from_backtrace?(line)
- # TODO (David 2011-12-25) why are we asking the configuration to do
- # stuff? Either use the patterns directly or enapsulate the filtering
- # in a BacktraceCleaner object.
- RSpec::Core::BacktraceCleaner.new(backtrace_include_patterns, backtrace_clean_patterns).exclude?(line)
- end
-
# Returns the configured mock framework adapter module
def mock_framework
mock_with :rspec unless @mock_framework
View
2  lib/rspec/core/formatters/helpers.rb
@@ -18,7 +18,7 @@ def format_backtrace(backtrace, options = {})
protected
def backtrace_line(line)
- return nil if RSpec.configuration.cleaned_from_backtrace?(line)
+ return nil if RSpec.configuration.backtrace_cleaner.exclude?(line)
RSpec::Core::Metadata::relative_path(line)
rescue SecurityError
nil
View
14 spec/rspec/core/configuration_spec.rb
@@ -970,29 +970,29 @@ def metadata_hash(*args)
end
end
- describe "#cleaned_from_backtrace? defaults" do
+ describe ".backtrace_cleaner#exclude? defaults" do
it "returns true for rspec files" do
- expect(config.cleaned_from_backtrace?("lib/rspec/core.rb")).to be_true
+ expect(config.backtrace_cleaner.exclude?("lib/rspec/core.rb")).to be_true
end
it "returns true for spec_helper" do
- expect(config.cleaned_from_backtrace?("spec/spec_helper.rb")).to be_true
+ expect(config.backtrace_cleaner.exclude?("spec/spec_helper.rb")).to be_true
end
it "returns true for java files (for JRuby)" do
- expect(config.cleaned_from_backtrace?("org/jruby/RubyArray.java:2336")).to be_true
+ expect(config.backtrace_cleaner.exclude?("org/jruby/RubyArray.java:2336")).to be_true
end
it "returns true for files within installed gems" do
- expect(config.cleaned_from_backtrace?('ruby-1.8.7-p334/gems/mygem-2.3.0/lib/mygem.rb')).to be_true
+ expect(config.backtrace_cleaner.exclude?('ruby-1.8.7-p334/gems/mygem-2.3.0/lib/mygem.rb')).to be_true
end
it "returns false for files in projects containing 'gems' in the name" do
- expect(config.cleaned_from_backtrace?('code/my-gems-plugin/lib/plugin.rb')).to be_false
+ expect(config.backtrace_cleaner.exclude?('code/my-gems-plugin/lib/plugin.rb')).to be_false
end
it "returns false for something in the current working directory" do
- expect(config.cleaned_from_backtrace?("#{Dir.getwd}/arbitrary")).to be_false
+ expect(config.backtrace_cleaner.exclude?("#{Dir.getwd}/arbitrary")).to be_false
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.