Permalink
Browse files

Add specs for new default behaviour of backtrace cleaner.

Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information...
1 parent 8028d74 commit 81a5b2c295c5960d5dd3a6985e239ac9e0c6abfe @samphippen committed Mar 25, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 spec/rspec/core/backtrace_cleaner_spec.rb
@@ -38,5 +38,19 @@ module RSpec::Core
expect(cleaner.exclude? "fish").to be_false
end
end
+
+ context "with an exclusion pattern that matches the current working directory" do
+ it "defaults to having one inclusion pattern, the current working directory" do
+ cleaner = BacktraceCleaner.new(nil, [/.*/])
+ expect(Dir.getwd =~ cleaner.inclusion_patterns.first).to be_true
+ end
+ end
+
+ context "with an exclusion pattern that does not match the current working directory" do
+ it "defaults to having no exclusion patterns" do
+ cleaner = BacktraceCleaner.new(nil, [/i_wont_match_a_directory/])
+ expect(cleaner.inclusion_patterns.length).to be_zero
+ end
+ end
end
end

0 comments on commit 81a5b2c

Please sign in to comment.