From 8b8ab13cb5a8326d9911f99ac52b40116da05802 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Tue, 1 Sep 2020 22:27:21 +0900 Subject: [PATCH] Removed hard but meaningless tests --- lib/apkstats/plugin.rb | 1 + spec/apkstats_spec.rb | 50 ------------------------------------------ 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/lib/apkstats/plugin.rb b/lib/apkstats/plugin.rb index bb80acb..4a67e60 100644 --- a/lib/apkstats/plugin.rb +++ b/lib/apkstats/plugin.rb @@ -307,6 +307,7 @@ def apkanalyzer_command command_path = command_path.chomp raise Error, "Please include apkanalyer in your PATH or specify it explicitly." if command_path.empty? + raise Error, "#{command_path} is not executable." unless File.executable?(command_path) @apkanalyzer_command = Apkstats::Command::ApkAnalyzer.new(command_path: command_path) end diff --git a/spec/apkstats_spec.rb b/spec/apkstats_spec.rb index 2b89d3b..a6548aa 100644 --- a/spec/apkstats_spec.rb +++ b/spec/apkstats_spec.rb @@ -4,11 +4,6 @@ module Danger describe Danger::DangerApkstats do - before do - ENV.delete("ANDROID_HOME") - ENV.delete("ANDROID_SDK_ROOT") - end - it "should be a plugin" do expect(Danger::DangerApkstats.new(nil)).to be_a Danger::Plugin end @@ -22,51 +17,6 @@ module Danger allow(apkstats.github).to receive(:pr_json).and_return(json) end - # compatibility - describe "#command_path=" do - context "unless command_path is given" do - it { expect { apkstats.send(:apkanalyzer_command) }.to raise_error(Danger::DangerApkstats::Error) } - - context "with ANDROID_HOME" do - before do - ENV["ANDROID_HOME"] = "dummy" - end - - it { expect(apkstats.send(:apkanalyzer_command)).to be_kind_of(Apkstats::Command::ApkAnalyzer) } - end - end - - context "if command_path is given" do - before do - apkstats.command_path = "dummy" - end - - it { expect(apkstats.send(:apkanalyzer_command)).to be_kind_of(Apkstats::Command::ApkAnalyzer) } - end - end - - describe "#apkanalyzer_path=" do - context "unless analyzer_path is given" do - it { expect { apkstats.send(:apkanalyzer_command) }.to raise_error(Danger::DangerApkstats::Error) } - - context "with ANDROID_HOME" do - before do - ENV["ANDROID_HOME"] = "dummy" - end - - it { expect(apkstats.send(:apkanalyzer_command)).to be_kind_of(Apkstats::Command::ApkAnalyzer) } - end - end - - context "if analyzer_path is given" do - before do - apkstats.apkanalyzer_path = "dummy" - end - - it { expect(apkstats.send(:apkanalyzer_command)).to be_kind_of(Apkstats::Command::ApkAnalyzer) } - end - end - describe "#compare_with" do let(:apk_base) { fixture_path + "app-base.apk" } let(:apk_other1) { fixture_path + "app-other1.apk" }