Skip to content

Commit

Permalink
Merge pull request #1119 from rspec/switch_to_support_just_caller_filter
Browse files Browse the repository at this point in the history
Switch just CallerFilter over to rspec-support
  • Loading branch information
JonRowe committed Oct 22, 2013
2 parents 457a23c + 96c783b commit 853d920
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 211 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -2,7 +2,7 @@ source "https://rubygems.org"

gemspec

%w[rspec rspec-expectations rspec-mocks].each do |lib|
%w[rspec rspec-expectations rspec-mocks rspec-support].each do |lib|
library_path = File.expand_path("../../#{lib}", __FILE__)
if File.exist?(library_path)
gem lib, :path => library_path
Expand Down
81 changes: 0 additions & 81 deletions benchmarks/caller.rb

This file was deleted.

7 changes: 5 additions & 2 deletions lib/rspec/core.rb
Expand Up @@ -11,7 +11,11 @@
require 'set'
require 'time'
require 'rbconfig'
require_rspec['core/caller_filter']

require_rspec['core/version']

require 'rspec/support/caller_filter'

require_rspec['core/flat_map']
require_rspec['core/filter_manager']
require_rspec['core/dsl']
Expand All @@ -35,7 +39,6 @@
require_rspec['core/shared_example_group/collection']
require_rspec['core/shared_example_group']
require_rspec['core/example_group']
require_rspec['core/version']

module RSpec
autoload :SharedContext, 'rspec/core/shared_context'
Expand Down
55 changes: 0 additions & 55 deletions lib/rspec/core/caller_filter.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rspec/core/rake_task.rb
@@ -1,4 +1,4 @@
require 'rspec/core/warnings'
require 'rspec/support/warnings'
require 'rake'
require 'rake/tasklib'
require 'shellwords'
Expand Down
8 changes: 8 additions & 0 deletions rspec-core.gemspec
Expand Up @@ -25,6 +25,14 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 1.8.7'

if RSpec::Core::Version::STRING =~ /[a-zA-Z]+/
# rspec-support is locked to our version when running pre,rc etc
s.add_runtime_dependency "rspec-support", "= #{RSpec::Core::Version::STRING}"
else
# rspec-support must otherwise match our major/minor version
s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['0']).join('.')}"
end

s.add_development_dependency "rake", "~> 10.0.0"
s.add_development_dependency "cucumber", "~> 1.1.9"
s.add_development_dependency "aruba", "~> 0.5"
Expand Down
43 changes: 0 additions & 43 deletions spec/rspec/core/caller_filter_spec.rb

This file was deleted.

2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -115,6 +115,8 @@ def without_env_vars(*vars)
end
end

require 'rspec/support/spec'

RSpec.configure do |c|
# structural
c.alias_it_behaves_like_to 'it_has_behavior'
Expand Down
28 changes: 0 additions & 28 deletions spec/support/helper_methods.rb
Expand Up @@ -23,32 +23,4 @@ def safely
end
end

def expect_deprecation_with_call_site(file, line)
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
expect(options[:call_site]).to include([file, line].join(':'))
end
end

def allow_deprecation
allow(RSpec.configuration.reporter).to receive(:deprecation)
end

def expect_warning_without_call_site(expected = //)
expect(::Kernel).to receive(:warn) do |message|
expect(message).to match expected
expect(message).to_not match(/Called from/)
end
end

def expect_warning_with_call_site(file, line, expected = //)
expect(::Kernel).to receive(:warn) do |message|
expect(message).to match expected
expect(message).to match(/Called from #{file}:#{line}/)
end
end

def allow_warning
allow(::Kernel).to receive(:warn)
end

end

0 comments on commit 853d920

Please sign in to comment.