Sha256: 17cac045098845f842f90fe7e9d86d81f55b8c360db3d41d86435039d72ac325

Contents?: true

Size: 692 Bytes

Versions: 6

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Sinclair::MethodDefinition::BlockDefinition do
  let(:klass)    { Class.new }
  let(:instance) { klass.new }

  describe '#build' do
    subject(:method_definition) do
      described_class.new(method_name) do
        @x = @x.to_i + 1
      end
    end

    let(:method_name) { :the_method }

    it_behaves_like 'MethodDefinition#build without cache'

    context 'with cached options' do
      subject(:method_definition) do
        described_class.from(method_name, cached: cached_option) do
          @x = @x.to_i + 1
        end
      end

      it_behaves_like 'MethodDefinition#build with cache options'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sinclair-1.4.1 spec/lib/sinclair/method_definition/block_definition_spec.rb
sinclair-1.4.0 spec/lib/sinclair/method_definition/block_definition_spec.rb
sinclair-1.3.4 spec/lib/sinclair/method_definition/block_definition_spec.rb
sinclair-1.3.3 spec/lib/sinclair/method_definition/block_definition_spec.rb
sinclair-1.3.2 spec/lib/sinclair/method_definition/block_definition_spec.rb
sinclair-1.3.1 spec/lib/sinclair/method_definition/block_definition_spec.rb