Sha256: 2c2807c030939f0889bd58fede07c47fe3be5432f5fb89b1aed4b42827bf1090

Contents?: true

Size: 857 Bytes

Versions: 31

Compression:

Stored size: 857 Bytes

Contents

shared_examples_for 'search_with' do |operation_class, options={}|
  name = options.fetch(:name)

  context name do
    subject(:with_operator) do
      base_class.search_with_operator_by_name[name]
    end

    it { should be_a operation_class }

    options.each do |key, value|
      # skip :name since it use used to look up operator, so it's already been checked or with_operator would be `nil`
      unless key == :name
        its(key) { should == value }
      end
    end

    context 'help' do
      subject(:help) do
        with_operator.help
      end

      context 'with en locale' do
        around(:each) do |example|
          I18n.with_locale(:en) do
            example.run
          end
        end

        it 'should have translation' do
          help.should_not include('translation missing')
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metasploit-model-0.28.0 spec/support/shared/examples/search_with.rb
metasploit-model-0.28.0-java spec/support/shared/examples/search_with.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/support/shared/examples/search_with.rb
metasploit-model-0.27.4 spec/support/shared/examples/search_with.rb
metasploit-model-0.27.4-java spec/support/shared/examples/search_with.rb
metasploit-model-0.27.3 spec/support/shared/examples/search_with.rb
metasploit-model-0.27.3-java spec/support/shared/examples/search_with.rb
metasploit-model-0.27.2 spec/support/shared/examples/search_with.rb
metasploit-model-0.27.2-java spec/support/shared/examples/search_with.rb
metasploit-model-0.27.1 spec/support/shared/examples/search_with.rb
metasploit-model-0.27.1-java spec/support/shared/examples/search_with.rb
metasploit-model-0.27.0 spec/support/shared/examples/search_with.rb
metasploit-model-0.27.0-java spec/support/shared/examples/search_with.rb
metasploit-model-0.27.0.pre.dep.pre.railties spec/support/shared/examples/search_with.rb
metasploit-model-0.26.1-java spec/support/shared/examples/search_with.rb
metasploit-model-0.26.1 spec/support/shared/examples/search_with.rb
metasploit-model-0.25.7 spec/support/shared/examples/search_with.rb
metasploit-model-0.25.7-java spec/support/shared/examples/search_with.rb
metasploit-model-0.25.6 spec/support/shared/examples/search_with.rb
metasploit-model-0.25.6-java spec/support/shared/examples/search_with.rb