File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33STUBS_PATH = File . expand_path ( "../stubs" , __FILE__ )
4- PROD_SCRIPTS_PATH = Stoplight ::Infrastructure ::Redis ::Storage ::Scripting . default_scripts_path
54
6- RSpec . configure do |config |
7- config . before ( :each , :redis ) do
8- allow ( Stoplight ::Infrastructure ::Redis ::Storage ::Scripting )
9- . to receive ( :default_scripts_path )
10- . and_return ( [ STUBS_PATH , *PROD_SCRIPTS_PATH ] )
5+ class Stoplight ::Infrastructure ::Redis ::Storage ::Scripting
6+ class << self
7+ alias_method :production_default_scripts_path , :default_scripts_path
8+
9+ def default_scripts_path
10+ [ STUBS_PATH , *production_default_scripts_path ]
11+ end
1112 end
1213end
Original file line number Diff line number Diff line change @@ -16,11 +16,13 @@ def freeze(time = Time.now)
1616 redis . rpop ( STACK_KEY )
1717 end
1818 end
19- else
19+ elsif redis . exists? ( STACK_KEY )
2020 redis . del ( STACK_KEY )
2121 Timecop . freeze ( time )
2222 redis_time_ms = Time . now . to_f * 1000.0
2323 redis . rpush ( STACK_KEY , redis_time_ms )
24+ else
25+ raise LocalJumpError , "freeze requires a block"
2426 end
2527 end
2628
You can’t perform that action at this time.
0 commit comments