Sha256: 046bf4fd6f44363a7862a583ce4bded6aa69f287c36a4e6f9d45f21a2ac087cf

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

require 'spec_helper'

describe Frenetic::StructureMethodDefiner do
  let(:my_temp_resource) { Class.new }

  before do
    stub_const('MyTempResource', my_temp_resource)
    MyTempResource.send(:extend, described_class)
  end

  describe '.structure' do
    before do
      MyTempResource.structure do
        123
      end
    end

    subject { MyTempResource.instance_variable_get('@_structure_block') }

    it 'stores a reference to the block' do
      expect(subject).to_not be_nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frenetic-3.0.1 spec/concerns/structure_method_definer_spec.rb
frenetic-3.0.0 spec/concerns/structure_method_definer_spec.rb