Module: GollyUtils::Testing::DeferrableSpecs::ClassMethods
- Defined in:
- lib/golly-utils/testing/rspec/deferrable_specs.rb
Instance Method Summary collapse
-
#deferrable_spec(key, name, &block) ⇒ Object
Declares a test case that will start paused and not run until allowed within another test case.
Instance Method Details
#deferrable_spec(key, name, &block) ⇒ Object
Declares a test case that will start paused and not run until allowed within another test case.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/golly-utils/testing/rspec/deferrable_specs.rb', line 57 def deferrable_spec(key, name, &block) raise "Invalid test key; please pass a Symbol." unless key.is_a?(Symbol) raise "Invalid test name; please pass a String." unless name.is_a?(String) raise "You must provide a block of test code. This test needs to do something." if block.nil? raise "The key #{key.inspect} has already been used." if deferrable_specs[key] deferrable_specs[key]= {block: block} class_eval <<-EOB it(#{name.inspect}){ deferred_join #{key.inspect} } EOB end |