Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 3b925dc

Browse files
committed
Merge pull request #161 from cstrahan/link-system-install
Properly link to the system's libv8
2 parents fd44693 + 2fca693 commit 3b925dc

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

ext/libv8/location.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class System < Location
4848
def configure(context = MkmfContext.new)
4949
context.send(:dir_config, 'v8')
5050
context.send(:find_header, 'v8.h') or fail NotFoundError
51+
context.send(:have_library, 'v8') or fail NotFoundError
5152
end
5253

5354
class NotFoundError < StandardError

spec/location_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,28 @@
1212
describe "configuring a compliation context with it" do
1313
before do
1414
@context.stub(:find_header) {true}
15+
@context.stub(:have_library) {true}
1516
@location.configure @context
1617
end
1718
it "adds the include path to the front of the include flags" do
1819
@context.should have_received(:dir_config).with('v8').at_least(:once)
1920
@context.should have_received(:find_header).with('v8.h').at_least(:once)
21+
@context.should have_received(:have_library).with('v8').at_least(:once)
22+
end
23+
end
24+
describe "when the v8 library cannot be found" do
25+
before do
26+
@context.stub(:find_header) {true}
27+
@context.stub(:have_library) {false}
28+
end
29+
it "raises a NotFoundError" do
30+
expect {@location.configure @context}.to raise_error Libv8::Location::System::NotFoundError
2031
end
2132
end
2233
describe "when the v8.h header cannot be found" do
2334
before do
2435
@context.stub(:find_header) {false}
36+
@context.stub(:have_library) {true}
2537
end
2638
it "raises a NotFoundError" do
2739
expect {@location.configure @context}.to raise_error Libv8::Location::System::NotFoundError

0 commit comments

Comments
 (0)