Module: Rohbau::ItBehavesLike
- Included in:
- MiniTest::Spec
- Defined in:
- lib/rohbau/it_behaves_like.rb
Instance Method Summary collapse
Instance Method Details
#get_shared_example(spec_name) ⇒ Object
6 7 8 |
# File 'lib/rohbau/it_behaves_like.rb', line 6 def get_shared_example(spec_name) Rohbau::SharedSpec::SpecIndex.get spec_name end |
#it_behaves_like(spec) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rohbau/it_behaves_like.rb', line 10 def it_behaves_like(spec) if spec.kind_of? Proc shared_example = spec else shared_example = get_shared_example(spec) end raise "No shared spec for #{spec.inspect} found" unless shared_example instance_eval(&shared_example) end |