Skip to content

Commit

Permalink
Merge pull request #35 from liaogz82/version_1.2.0
Browse files Browse the repository at this point in the history
Update plugin version to 1.2.0
  • Loading branch information
mosesliao authored Dec 19, 2018
2 parents 5a471c9 + 0f06b30 commit 56137a4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
16 changes: 13 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: mosesliao/ruby-lizard:latest
- image: circleci/ruby

working_directory: ~/repo

Expand All @@ -30,10 +30,20 @@ jobs:
- ./vendor
key: v1-dependencies-{{ checksum "Gemfile" }}

# run tests!
# run no lizard tests
- run:
name: run no lizard tests
command: bundle exec rspec --tag type:no_lizard

# Install Lizard
- run:
name: run tests
command: bundle exec rake
command: sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get install -y python3-pip && sudo pip3 install lizard --upgrade

# run lizard tests
- run:
name: run lizard tests
command: bundle exec rspec --tag type:lizard

# collect reports
- store_test_results:
Expand Down
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/lizard/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Fastlane
module Lizard
VERSION = "1.1.1"
VERSION = "1.2.0"
CLI_VERSION = "1.14.10"
end
end
39 changes: 24 additions & 15 deletions spec/lizard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
let(:wrong_executable) { "../spec/fixtures" }

context "executable" do
it "fails with invalid sourcemap path" do
it 'fails if lizard is not installed', type: :no_lizard do
expect do
Fastlane::FastFile.new.parse("lane :test do
lizard(
)
end").runner.execute(:test)
end.to raise_error("You have to install lizard using `[sudo] pip install lizard` or specify the executable path with the `:executable` option.")
end

it "fails with invalid sourcemap path", type: :lizard do
sourcemap_path = File.absolute_path '../no/such/lizard.py'
expect do
Fastlane::FastFile.new.parse("lane :test do
Expand All @@ -26,7 +35,7 @@
end
end

context "required version" do
context "required version", type: :lizard do
it "should not raise if executable version is same as required" do
expect(FastlaneCore::UI).to_not(receive(:user_error!))
Fastlane::FastFile.new.parse("lane :test do
Expand Down Expand Up @@ -68,7 +77,7 @@
end
end

context "default use case" do
context "default use case", type: :lizard do
it "default language as swift" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard
Expand All @@ -78,7 +87,7 @@
end
end

context "when specify custom executable" do
context "when specify custom executable", type: :lizard do
it "uses custom executable" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -100,7 +109,7 @@
end
end

context "when specify export_type as XML" do
context "when specify export_type as XML", type: :lizard do
it "prints out XML as stdout" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -112,7 +121,7 @@
end
end

context "when specify export_type as HTML" do
context "when specify export_type as HTML", type: :lizard do
it "prints out HTML as stdout" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -124,7 +133,7 @@
end
end

context "when specify export_type as CSV" do
context "when specify export_type as CSV", type: :lizard do
it "prints out CSV as stdout" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -136,7 +145,7 @@
end
end

context "when specify folder to scan" do
context "when specify folder to scan", type: :lizard do
it "states the source folder" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -148,7 +157,7 @@
end
end

context "when specify language to scan" do
context "when specify language to scan", type: :lizard do
it "overrides swift default language" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -160,7 +169,7 @@
end
end

context "when specify multiple languages to scan" do
context "when specify multiple languages to scan", type: :lizard do
it "states all specified languages" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -172,7 +181,7 @@
end
end

context "when specify code complexity number" do
context "when specify code complexity number", type: :lizard do
it "overrides default 15" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -184,7 +193,7 @@
end
end

context "when specify maximum function length warning" do
context "when specify maximum function length warning", type: :lizard do
it "overrides default 1000" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -196,7 +205,7 @@
end
end

context "when specify number of working threads" do
context "when specify number of working threads", type: :lizard do
it "overrides default single thread" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand All @@ -208,7 +217,7 @@
end
end

context "the `ignore_exit_status` option" do
context "the `ignore_exit_status` option", type: :lizard do
context "by default" do
it 'should raise if lizard completes with a non-zero exit status' do
allow(FastlaneCore::UI).to receive(:important)
Expand Down Expand Up @@ -256,7 +265,7 @@
end
end

context "when specify report_file options" do
context "when specify report_file options", type: :lizard do
it "adds redirect file to command" do
result = Fastlane::FastFile.new.parse("lane :test do
lizard(
Expand Down

0 comments on commit 56137a4

Please sign in to comment.