Sha256: 1ec20c6dc291403d5bee804841a88403b0c763357f7a19d5ef4da6ac39a25c67

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

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

  describe '#build' do
    subject(:method_definition) do
      described_class.new(method_name, code)
    end

    let(:method_name) { :the_method }

    let(:code) { '@x = @x.to_i + 1' }

    it_behaves_like 'ClassMethodDefinition#build without cache'

    context 'with cached options' do
      subject(:method_definition) do
        described_class.new(method_name, code, cached: cached_option)
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinclair-1.4.2 spec/lib/sinclair/method_definition/class_string_definition_spec.rb