This repository was archived by the owner on Dec 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments