From aaddd5d4a6bcac3f79783c53df1be7d8829d02b7 Mon Sep 17 00:00:00 2001 From: Valerio Mazzeo Date: Mon, 1 Aug 2016 20:47:55 +0100 Subject: [PATCH] compiling --- Gemfile.lock | 113 +++++++++++++++++++++++++++++++++++++++ lib/xcodebuild/plugin.rb | 12 ++--- spec/xcodebuild_spec.rb | 5 +- 3 files changed, 120 insertions(+), 10 deletions(-) create mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..7954176 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,113 @@ +PATH + remote: . + specs: + danger-xcodebuild (0.0.1) + danger (~> 2.0) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.4.0) + claide (1.0.0) + claide-plugins (0.9.1) + cork + nap + open4 (~> 1.3) + coderay (1.1.1) + colored (1.2) + cork (0.1.0) + colored (~> 1.2) + danger (2.1.1) + claide (~> 1.0) + claide-plugins (> 0.9.0) + colored (~> 1.2) + cork (~> 0.1) + faraday (~> 0) + faraday-http-cache (~> 1.0) + git (~> 1) + kramdown (~> 1.5) + octokit (~> 4.2) + terminal-table (~> 1) + diff-lcs (1.2.5) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + faraday-http-cache (1.3.0) + faraday (~> 0.8) + ffi (1.9.14) + formatador (0.2.5) + git (1.3.0) + guard (2.14.0) + formatador (>= 0.2.4) + listen (>= 2.7, < 4.0) + lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.7.3) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + kramdown (1.11.1) + listen (3.0.7) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9.7) + lumberjack (1.0.10) + method_source (0.8.2) + multipart-post (2.0.0) + nap (1.1.0) + nenv (0.3.0) + notiffany (0.1.1) + nenv (~> 0.1) + shellany (~> 0.0) + octokit (4.3.0) + sawyer (~> 0.7.0, >= 0.5.3) + open4 (1.3.4) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + rake (10.5.0) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.2) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + sawyer (0.7.0) + addressable (>= 2.3.5, < 2.5) + faraday (~> 0.8, < 0.10) + shellany (0.0.1) + slop (3.6.0) + terminal-table (1.6.0) + thor (0.19.1) + yard (0.9.5) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.3) + danger-xcodebuild! + guard (~> 2.14) + guard-rspec (~> 4.7) + listen (= 3.0.7) + pry + rake (~> 10.0) + rspec (~> 3.4) + yard (~> 0.8) + +BUNDLED WITH + 1.12.5 diff --git a/lib/xcodebuild/plugin.rb b/lib/xcodebuild/plugin.rb index 8d3f46e..1a36487 100644 --- a/lib/xcodebuild/plugin.rb +++ b/lib/xcodebuild/plugin.rb @@ -17,10 +17,11 @@ class DangerXcodebuild < Plugin # Allows you to specify an xcodebuild JSON file location to parse. attr_accessor :xcodebuild_json - def initialize - @warning_count = 0 - @error_count = 0 - @test_failures_count = 0 + def initialize(arg) + super + @warning_count = 0 + @error_count = 0 + @test_failures_count = 0 end # Parses and exposes eventual warnings. @@ -48,10 +49,9 @@ def parse_tests # @return [is_perfect_build] # def perfect_build - is_perfect_build = @warning_count == 0 && @errors.count == 0 && @test_failures.count == 0 + is_perfect_build = @warning_count == 0 && @error_count == 0 && @test_failures_count == 0 message("Perfect build 👍🏻") if is_perfect_build return is_perfect_build - end end def self.instance_name diff --git a/spec/xcodebuild_spec.rb b/spec/xcodebuild_spec.rb index c9851be..ebdd145 100644 --- a/spec/xcodebuild_spec.rb +++ b/spec/xcodebuild_spec.rb @@ -16,10 +16,7 @@ module Danger end it "is a perfect build" do - monday_date = Date.parse("2016-07-11") - allow(Date).to receive(:today).and_return monday_date - - expect(@xcodebuild.perfect_build).to be_true + expect(@xcodebuild.perfect_build).to be true expect(@dangerfile.status_report[:messages]).to eq(["Perfect build 👍🏻"]) end