Sha256: 23819c9590f47b669246c7c28627d6c305af74392319480de0b0c42a87e2b38f

Contents?: true

Size: 857 Bytes

Versions: 8

Compression:

Stored size: 857 Bytes

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

describe HammerCLI::MainCommand do

  describe "loading context" do

    let(:context) { {} }
    let(:cmd) { HammerCLI::MainCommand.new("", context) }

    before :each do
      cmd.stubs(:execute).returns(1)
    end

    describe "username" do

      it "should prioritize parameter" do
        cmd.run(["-uuser"])
        context[:username].must_equal "user"
      end

      it "should prioritize parameter 2" do
        cmd.run([])
        context[:username].must_equal nil
      end

    end


    describe "password" do

      it "should prioritize parameter" do
        cmd.run(["-ppassword"])
        context[:password].must_equal "password"
      end

      it "should prioritize parameter" do
        cmd.run([])
        context[:password].must_equal nil
      end

    end


  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hammer_cli-0.0.18 test/unit/main_test.rb
hammer_cli-0.0.16 test/unit/main_test.rb
hammer_cli-0.0.15 test/unit/main_test.rb
hammer_cli-0.0.14 test/unit/main_test.rb
hammer_cli-0.0.13 test/unit/main_test.rb
hammer_cli-0.0.12 test/unit/main_test.rb
hammer_cli-0.0.11 test/unit/main_test.rb
hammer_cli-0.0.10 test/unit/main_test.rb