Sha256: d97ce1a16875872d2346594f6a8f21825ac7534b688f8faf5b4bceffec2ce5bc

Contents?: true

Size: 1.67 KB

Versions: 33

Compression:

Stored size: 1.67 KB

Contents

require 'test/unit'
require 'thor'
require 'fileutils'
require 'xamarin-test-cloud/cli'

class TestParser < Test::Unit::TestCase
  def test_should_raise_if_no_app_or_api_key_is_given
    script = XamarinTestCloud::CLI.new([])
    assert_raise Thor::InvocationError do
      script.invoke(:submit)
    end

    script = XamarinTestCloud::CLI.new(["test/ipa/2012 Olympics_cal.ipa"])
    assert_raise Thor::InvocationError do
      script.invoke(:submit)
    end


  end

  def test_should_raise_if_app_is_not_file_ipa_or_apk
    script = XamarinTestCloud::CLI.new(["test/ipa/NONE_EXIST_2012 Olympics_cal.ipa","JIFZCTPZJJXJLEKMMYRY","."])
    assert_raise RuntimeError do
      script.invoke(:submit)
    end

    script = XamarinTestCloud::CLI.new(["test/ipa/features.zip","JIFZCTPZJJXJLEKMMYRY","."])

    assert_raise RuntimeError do
      script.invoke(:submit)
    end
  end

  def test_should_parse_all_configuration_options
    FileUtils.rm_f(File.join("test","vendor"))
    FileUtils.rm_f(File.join("test","Gemfile"))
    FileUtils.rm_f(File.join("test","Gemfile.lock"))

    config_options = {
        :host => "http://localhost:8080",
        :workspace => "test",
        :features => "test/ipa/features.zip",
        :config => "test/config/cucumber.yml",
        :profile => "a",
        "skip-check" => false,
        "reset-between-scenarios" => false,
        "dry-run" => true
    }
    script = XamarinTestCloud::CLI.new(["test/ipa/2012 Olympics_cal.ipa","JIFZCTPZJJXJLEKMMYRY"],config_options)


    script.invoke(:submit)

    FileUtils.rm_f(File.join("test","vendor","cache"))
    FileUtils.rm_f(File.join("test","Gemfile"))
    FileUtils.rm_f(File.join("test","Gemfile.lock"))



  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
xamarin-test-cloud-0.9.35 test/test_parser.rb
xamarin-test-cloud-0.9.34 test/test_parser.rb
xamarin-test-cloud-0.9.33 test/test_parser.rb
xamarin-test-cloud-0.9.32 test/test_parser.rb
xamarin-test-cloud-0.9.31 test/test_parser.rb
xamarin-test-cloud-0.9.30 test/test_parser.rb
xamarin-test-cloud-0.9.29 test/test_parser.rb
xamarin-test-cloud-0.9.28 test/test_parser.rb
xamarin-test-cloud-0.9.27 test/test_parser.rb
xamarin-test-cloud-0.9.26 test/test_parser.rb
xamarin-test-cloud-0.9.25 test/test_parser.rb
xamarin-test-cloud-0.9.23 test/test_parser.rb
xamarin-test-cloud-0.9.22 test/test_parser.rb
xamarin-test-cloud-0.9.21 test/test_parser.rb
xamarin-test-cloud-0.9.20 test/test_parser.rb
xamarin-test-cloud-0.9.19 test/test_parser.rb
xamarin-test-cloud-0.9.18 test/test_parser.rb
xamarin-test-cloud-0.9.17 test/test_parser.rb
xamarin-test-cloud-0.9.16 test/test_parser.rb
xamarin-test-cloud-0.9.15 test/test_parser.rb