Sha256: 852956dbd2ebea24c0cd2c2557a5ff6caea1f96dc589e5746a8cd6d705e2fb11

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

# encoding: UTF-8

require "spec_helper"

describe Tetra::AntRunner do
  it_behaves_like Tetra::KitRunner
  include Tetra::Mockers

  before(:each) do
    create_mock_project
    @kit_runner = Tetra::AntRunner.new(@project)
  end

  after(:each) do
    delete_mock_project
  end

  describe "#get_ant_commandline"  do
    it "returns commandline options for running Ant" do
      executable_path = create_mock_executable("ant")
      @project.from_directory do
        commandline = @kit_runner.get_ant_commandline(".")
        expect(commandline).to eq "./#{executable_path}"
      end
    end
    it "doesn't return commandline options if Ant is not available" do
      expect { @kit_runner.get_ant_commandline(".") }.to raise_error(Tetra::ExecutableNotFoundError)
    end
  end

  describe "#ant"  do
    it "runs Ant" do
      create_mock_executable("ant")
      @project.from_directory do
        @kit_runner.ant(["extra-option"])
        expect(File.read("test_out").strip).to match(/extra-option$/)
      end
    end
    it "doesn't run Ant if it is not available" do
      @project.from_directory do
        expect { @kit_runner.ant([]) }.to raise_error(Tetra::ExecutableNotFoundError)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tetra-0.46.0 spec/lib/ant_runner_spec.rb
tetra-0.45.0 spec/lib/ant_runner_spec.rb
tetra-0.44.0 spec/lib/ant_runner_spec.rb
tetra-0.43.0 spec/lib/ant_runner_spec.rb
tetra-0.42.0 spec/lib/ant_runner_spec.rb
tetra-0.41.0 spec/lib/ant_runner_spec.rb
tetra-0.40.0 spec/lib/ant_runner_spec.rb