10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/transpec.rb', line 10
def self.required_rspec_version
@required_rspec_version ||= begin
gemspec_path = File.join(root, 'transpec.gemspec')
gem_specification = Gem::Specification.load(gemspec_path)
rspec_dependency = gem_specification.dependencies.find { |d| d.name == 'rspec' }
if rspec_dependency
rspec_requirement = rspec_dependency.requirement
gem_version = rspec_requirement.requirements.first.find { |r| r.is_a?(Gem::Version) }
RSpecVersion.new(gem_version)
else
current_rspec_version
end
end
end
|