Skip to content

Commit

Permalink
Removed hard but meaningless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatsu committed Sep 1, 2020
1 parent 8c08510 commit 8b8ab13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 50 deletions.
1 change: 1 addition & 0 deletions lib/apkstats/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 0 additions & 50 deletions spec/apkstats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" }
Expand Down

0 comments on commit 8b8ab13

Please sign in to comment.