<commit_before>require 'spec_helper'
require 'dpl/provider/testfairy'

describe DPL::Provider::TestFairy do

  before (:all) do
    @tempdir = Dir.mktmpdir

    %x[mkdir @tempdir/android/]
    ENV['ANDROID_HOME'] = File.join(@tempdir, 'android')
    %x[echo 'cp $3 $4' > #{@tempdir}/android/zipalign]
    %x[chmod +x #{@tempdir}/android/zipalign]

    @kyestore = File.join(@tempdir,'debug.keystore')
    %x[curl -Lso #{@kyestore} http://www.testfairy.com/support-files/travis/dpl/debug.keystore]

    @local_android_app = File.join(@tempdir, 'android.apk')
    %x[curl -Lso #{@local_android_app} http://www.testfairy.com/support-files/travis/dpl/android.apk]

    @local_ios_app = File.join(@tempdir, 'ios.ipa')
    %x[curl -Lso #{@local_ios_app} http://www.testfairy.com/support-files/travis/dpl/Empty.ipa]

  end

  subject :provider do
    # the account is <EMAIL>
    described_class.new(DummyContext.new, :api_key => '4b85a2c03ba6026f4e22640a0432638180e1d1ea', :storepass => "<PASSWORD>", :alias => "androiddebugkey", :keystore_file => @kyestore, :video => "true", :video_quality => 'low')
  end

  describe "#check_auth" do
    example "check_auth without app_file" do
      lambda {provider.check_auth}.should raise_error<commit_msg>Fix typo kyestore => keystore<commit_after>require 'spec_helper'
require 'dpl/provider/testfairy'

describe DPL::Provider::TestFairy do

  before (:all) do
    @tempdir = Dir.mktmpdir

    %x[mkdir @tempdir/android/]
    ENV['ANDROID_HOME'] = File.join(@tempdir, 'android')
    %x[echo 'cp $3 $4' > #{@tempdir}/android/zipalign]
    %x[chmod +x #{@tempdir}/android/zipalign]

    @keystore = File.join(@tempdir,'debug.keystore')
    %x[curl -Lso #{@keystore} http://www.testfairy.com/support-files/travis/dpl/debug.keystore]

    @local_android_app = File.join(@tempdir, 'android.apk')
    %x[curl -Lso #{@local_android_app} http://www.testfairy.com/support-files/travis/dpl/android.apk]

    @local_ios_app = File.join(@tempdir, 'ios.ipa')
    %x[curl -Lso #{@local_ios_app} http://www.testfairy.com/support-files/travis/dpl/Empty.ipa]

  end

  subject :provider do
    # the account is <EMAIL>
    described_class.new(DummyContext.new, :api_key => '4b85a2c03ba6026f4e22640a0432638180e1d1ea', :storepass => "<PASSWORD>", :alias => "androiddebugkey", :keystore_file => @keystore, :video => "true", :video_quality => 'low')
  end

  describe "#check_auth" do
    example "check_auth without app_file" do
      lambda {provider.check_auth}.should raise_error
{'fraction_non_alphanumeric': 0.16253002401921537, 'fraction_numerical': 0.02401921537229784, 'mean_word_length': 4.516556291390729, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1187177', 'n_tokens_mistral': 1001, 'n_tokens_neox': 939, 'n_words': 158}