Sha256: d3dad1b8cdb96ef8b81af11a750d626934cc27a0fe583f36eeb24af3a6f7b502

Contents?: true

Size: 920 Bytes

Versions: 5

Compression:

Stored size: 920 Bytes

Contents

require "test_helper"
require "jstdutil/cli"
require "fileutils"

class JstdutilCliTest < Test::Unit::TestCase
  context "running the cli" do
    should "run jstestdriver command through JsRedGreen with given jar" do
      jar = "path/to.jar"
      result = "REPORT"
      Jstdutil.expects(:run).with("--tests all ", jar).returns(result)
      Jstdutil::RedGreen.expects(:format).with(result).returns(result * 2)

      assert_equal result * 2, Jstdutil::Cli.run("--tests all --jar #{jar}".split(" "))
    end

    should "run jstestdriver command through JsRedGreen with jar from env" do
      jar = "path/to.jar"
      result = "REPORT"
      Jstdutil.expects(:jar).returns(jar)
      Jstdutil.expects(:run).with("--tests all", jar).returns(result)
      Jstdutil::RedGreen.expects(:format).with(result).returns(result * 2)

      assert_equal result * 2, Jstdutil::Cli.run("--tests all".split(" "))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jstdutil-0.1.2 test/cli_test.rb
jstdutil-0.1.1 test/cli_test.rb
jstdutil-0.1.0 test/cli_test.rb
jstdutil-0.0.2 test/cli_test.rb
jstdutil-0.0.1 test/cli_test.rb