Sha256: 0cd43115123e04afabc5c5b56e9f14fc957a68c73d22420c7866bd4d3e830e98

Contents?: true

Size: 907 Bytes

Versions: 38

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'

describe Metasploit::Model::Visitation::Visitor do
  context 'validations' do
    it { should validate_presence_of :block }
    it { should validate_presence_of :module_name }
    it { should 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
      instance.block.should == block
    end

    it 'should set #module_name from :module_name' do
      instance.module_name.should == module_name
    end

    it 'should set #parent from :parent' do
      instance.parent.should == parent
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
metasploit-model-1.0.0.pre.rails.pre.4.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.30.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.30.0-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.29.2 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.29.2-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.29.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.29.0-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.28.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.28.0-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.4 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.4-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.3 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.3-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.2 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.2-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.1 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.1-java spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.0 spec/app/models/metasploit/model/visitation/visitor_spec.rb
metasploit-model-0.27.0-java spec/app/models/metasploit/model/visitation/visitor_spec.rb