This repository was archived by the owner on Oct 19, 2018. 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 @@ -4,6 +4,9 @@ class ComponentLoader
44 private :v8_context
55
66 def initialize ( v8_context )
7+ unless v8_context
8+ raise ArgumentError . new ( 'Could not obtain ExecJS runtime context' )
9+ end
710 @v8_context = v8_context
811 end
912
Original file line number Diff line number Diff line change 1212 let ( :context ) { ExecJS . compile ( GLOBAL_WRAPPER + js ) }
1313 let ( :v8_context ) { context . instance_variable_get ( :@v8_context ) }
1414
15+ describe '.new' do
16+ it 'raises a meaningful exception when initialized without a context' do
17+ expect {
18+ described_class . new ( nil )
19+ } . to raise_error ( /Could not obtain ExecJS runtime context/ )
20+ end
21+ end
22+
1523 describe '#load' do
1624 it 'loads given asset file into context' do
1725 loader = described_class . new ( v8_context )
You can’t perform that action at this time.
0 commit comments