Sha256: 401f3fd5908a9425d6fdff62f496e0e441ac32f207602ebfe714fcd7573e13ba

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require File.expand_path("spec_helper", __dir__)

module Danger
  describe Danger::DangerApkstats do
    it "should be a plugin" do
      expect(Danger::DangerApkstats.new(nil)).to be_a Danger::Plugin
    end

    describe "with Dangerfile" do
      let(:dangerfile) { testing_dangerfile }
      let(:apkstats) { dangerfile.apkstats }

      before do
        json = File.read(fixture_path + "github_pr.json")
        allow(apkstats.github).to receive(:pr_json).and_return(json)
      end

      describe "#compare_with" do
        let(:apk_base) { fixture_path + "app-base.apk" }
        let(:apk_other1) { fixture_path + "app-other1.apk" }

        before do
          apkstats.apkanalyzer_path = `which apkanalyzer`.chomp
        end

        context "unless apk_filepath is specified" do
          it { expect(apkstats.compare_with(apk_other1, do_report: true)).to be_falsey }
        end

        context "otherwise" do
          before do
            apkstats.apk_filepath = apk_base
          end

          it { expect(apkstats.compare_with(apk_other1, do_report: true)).to be_truthy }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-apkstats-0.3.1 spec/apkstats_spec.rb