Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit c33e07d

Browse files
committed
Merge pull request #992 from rspec/expose_exe
Expose exe file location
2 parents 23fb6bd + a8161ef commit c33e07d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/rspec/core.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ class << self
136136
define_method(:now,&::Time.method(:now))
137137
end
138138
end
139+
140+
# @private path to executable file
141+
def self.path_to_executable
142+
File.expand_path('../../../exe/rspec', __FILE__)
143+
end
144+
139145
end
140146

141147
def self.const_missing(name)
@@ -154,4 +160,3 @@ def self.const_missing(name)
154160
end
155161
end
156162
end
157-

spec/rspec/core_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,10 @@
5252
expect(RSpec.world).not_to equal(world_before_reset)
5353
end
5454
end
55+
56+
describe "::Core.path_to_executable" do
57+
it 'returns the absolute location of the exe/rspec file' do
58+
expect(RSpec::Core.path_to_executable).to eq File.expand_path('../../../exe/rspec',__FILE__)
59+
end
60+
end
5561
end

0 commit comments

Comments
 (0)