spec/lib/sinclair/class_methods_spec.rb in sinclair-1.16.2 vs spec/lib/sinclair/class_methods_spec.rb in sinclair-1.16.3

- old
+ new

@@ -32,7 +32,23 @@ it 'returns the value' do expect(instance.some_method).to eq(1) end end + + context 'when no block is given' do + let(:builder_class) do + Class.new(Sinclair) do + def build + add_method(:some_method) { 1 } + super + end + end + end + + it 'executes the block and builds' do + expect { builder_class.build(dummy_class, options) } + .to add_method(:some_method).to(dummy_class) + end + end end end