Sha256: d4563d540e8897e1f67e15af147ecaccef4e2423538e2109f3703de2507c2926

Contents?: true

Size: 943 Bytes

Versions: 30

Compression:

Stored size: 943 Bytes

Contents

RSpec.describe Metasploit::Model::Visitation::Visitor, type: :model do
  context 'validations' do
    it { is_expected.to validate_presence_of :block }
    it { is_expected.to validate_presence_of :module_name }
    it { is_expected.to validate_presence_of :parent }
  end

  context '#initialize' do
    subject(:instance) do
      described_class.new(
          :module_name => module_name,
          :parent => parent,
          &block
      )
    end

    let(:block) do
      lambda { |node|
        node
      }
    end

    let(:module_name) do
      'Visited::Node'
    end

    let(:parent) do
      Class.new
    end

    it 'should set #block from &block' do
      expect(instance.block).to eq(block)
    end

    it 'should set #module_name from :module_name' do
      expect(instance.module_name).to eq(module_name)
    end

    it 'should set #parent from :parent' do
      expect(instance.parent).to eq(parent)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
metasploit-model-5.0.2 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-5.0.1 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-5.0.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.6 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.5 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.4 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.3 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.2 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.1 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-4.0.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-3.1.4 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-3.1.3 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-3.1.2 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-3.1.1 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-3.1.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-3.0.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-2.0.4 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-2.0.3 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-2.0.2 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-2.0.1 spec/app/models/metasploit/model/visitation/visitor_spec.rb