spec/command/apk_analyzer_spec.rb in danger-apkstats-0.1.2 vs spec/command/apk_analyzer_spec.rb in danger-apkstats-0.2.0
- old
+ new
@@ -8,10 +8,11 @@
let(:apk_other1) { fixture_path + "app-other1.apk" }
let(:apk_other2) { fixture_path + "app-other2.apk" }
let(:apk_other3) { fixture_path + "app-other3.apk" }
let(:apk_other4) { fixture_path + "app-other4.apk" }
let(:apk_other5) { fixture_path + "app-other5.apk" }
+ let(:apk_method64k) { fixture_path + "app-method64k.apk" }
it "should use custom path if set" do
expect(ApkAnalyzer.new({}).command_path).to eq("#{ENV.fetch('ANDROID_HOME')}/tools/bin/apkanalyzer")
expect(ApkAnalyzer.new(command_path: "/y/z").command_path).to eq("/y/z")
end
@@ -52,9 +53,19 @@
expect(command.min_sdk(apk_other5)).to eq("27")
end
it "target_sdk should return target sdk" do
expect(command.target_sdk(apk_base)).to eq("28")
+ end
+
+ it "method_reference_count should return reference count" do
+ expect(command.method_reference_count(apk_base)).to eq(15_720)
+ expect(command.method_reference_count(apk_method64k)).to eq(124_304)
+ end
+
+ it "dex_count should return dex count" do
+ expect(command.dex_count(apk_base)).to eq(1)
+ expect(command.dex_count(apk_method64k)).to eq(2)
end
end
context "to_permission" do
it "should return a permission without max_sdk" do