Sha256: e5801359cbb7c595494239aa3644607c65cbfe80515221ae672f365b01fba015

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

require 'spec_helper'
require 'ronin/installation'

describe Installation do
  it "should load the gemspec for the 'ronin' library" do
    subject.gems['ronin'].should_not be_nil
  end

  it "should provide the names of the installed Ronin libraries" do
    subject.libraries.should include('ronin')
  end

  let(:directory) { 'lib/ronin/ui/cli/commands' }
  let(:files) {
    %w[
      campaigns.rb
      console.rb
      creds.rb
      database.rb
      emails.rb
      exec.rb
      help.rb
      hosts.rb
      install.rb
      ips.rb
      net/proxy.rb
      repos.rb
      update.rb
      urls.rb
      uninstall.rb
      wordlist.rb
    ]
  }

  describe "each_file" do
    let(:pattern)  { File.join(directory,'**','*.rb') }
    let(:expected) { files.map { |name| File.join(directory,name) } }

    it "should enumerate over the files which match a glob pattern" do
      subject.each_file(pattern).to_a.should =~ expected
    end

    it "should return an Enumerator when no block is given" do
      subject.each_file(pattern).all? { |file|
        expected.include?(file)
      }.should == true
    end
  end

  describe "each_file_in" do
    let(:ext)      { :rb }
    let(:expected) { files }

    it "should enumerate over the files which match a glob pattern" do
      subject.each_file_in(directory,ext).to_a.should =~ expected
    end

    it "should return an Enumerator when no block is given" do
      subject.each_file_in(directory,ext).all? { |file|
        expected.include?(file)
      }.should == true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-1.5.0.rc2 spec/installation_spec.rb
ronin-1.5.0.rc1 spec/installation_spec.rb