Sha256: 24f541b83f2ffabc351776d4b8ab21af9a56cf686df4a74353b1cc97dedf4912

Contents?: true

Size: 1.3 KB

Versions: 43

Compression:

Stored size: 1.3 KB

Contents

require_relative 'test_helper.rb'

include Frank::Cucumber::Launcher
include Frank::Cucumber::FrankHelper

def wait_for_frank_to_come_up
  # orig FrankHelper::wait_for_frank_to_come_up
  # doing nothing
end

describe "frank cucumber launcher" do
  DUMMY_APP_PATH = '/tmp/dummy_app_path'

  before do
    `mkdir -p #{DUMMY_APP_PATH}`
  end

  describe "when the path is wrong" do
  
    it 'throws exception when no app path is given' do
      assert_raises(RuntimeError) do
        enforce(nil)
      end
    end

    it 'prints suggestions if available' do
        mock_locator = Mock.new
        mock_locator.expect :guess_possible_app_bundles_for_dir, ['suggestion_1'], ['']
        begin
          enforce(nil, mock_locator)
        rescue RuntimeError => e
          e.message.must_match "suggestion_1"
        end
    end

    it "throws exception when app path doesn't exist" do
      assert_raises(RuntimeError) do
        enforce('/foo/bar/baz/not/a/real/path')
      end
    end
  end

  describe "when starting the simulator with the specified params" do

    before do
      @simulator_direct_client = Mock.new 
      @simulator_direct_client.expect :relaunch, nil, [] 
    end
    
    it 'selects iphone mode by default' do
      launch_app(DUMMY_APP_PATH, 'X.Y')
      @version.must_equal 'iphone'
    end

  end

end

Version data entries

43 entries across 43 versions & 4 rubygems

Version Path
sc-frank-ios-1.2.3 test/launcher_test.rb
frank-cucumber-1.2.5 test/launcher_test.rb
frank-cucumber-1.2.4.pre1 test/launcher_test.rb
frank-pivotal-1.3.0.pre.2 test/launcher_test.rb
sc-frank-cucumber-1.2.1.bba52d7.debug test/launcher_test.rb
sc-frank-cucumber-1.2.1.e1e3ccb.debug test/launcher_test.rb
sc-frank-cucumber-1.2.1.1a856ca.debug test/launcher_test.rb
frank-pivotal-1.3.0.pre.1 test/launcher_test.rb
frank-pivotal-1.2.4 test/launcher_test.rb
frank-pivotal-1.2.3.pre.2 test/launcher_test.rb
frank-pivotal-1.2.3.pre.1 test/launcher_test.rb
frank-pivotal-1.2.3 test/launcher_test.rb
sc-frank-cucumber-1.2.1.b7791c5.debug test/launcher_test.rb
frank-cucumber-1.2.3 test/launcher_test.rb
sc-frank-cucumber-1.2.1.3256dc1.debug test/launcher_test.rb
sc-frank-cucumber-1.2.1.9c95c03.debug test/launcher_test.rb
sc-frank-cucumber-1.2.1.1dcc760.debug test/launcher_test.rb
frank-cucumber-1.2.2 test/launcher_test.rb
sc-frank-cucumber-1.2.1.1dcc760 test/launcher_test.rb
frank-cucumber-1.2.1 test/launcher_test.rb