spec/cli/helper_spec.rb in metric_fu-4.11.3 vs spec/cli/helper_spec.rb in metric_fu-4.11.4
- old
+ new
@@ -1,21 +1,18 @@
-require 'spec_helper'
-require 'metric_fu/cli/helper'
+require "spec_helper"
+require "metric_fu/cli/helper"
MetricFu.configuration.configure_metric(:rcov) do |rcov|
rcov.enabled = true
end
MetricFu.configure
describe MetricFu::Cli::Helper do
-
describe "defaults" do
-
let(:helper) { MetricFu::Cli::Helper.new }
let(:defaults) { helper.process_options }
context "on every Ruby version" do
-
it "opens the report in a browser" do
expect(defaults[:open]).to be_truthy
end
it "enables Flay" do
@@ -57,16 +54,15 @@
end
end
if MetricFu.configuration.mri?
- it "enables Rails Best Practices" do
- expect(defaults[:rails_best_practices]).to be_truthy
- end
+ it "enables Rails Best Practices" do
+ expect(defaults[:rails_best_practices]).to be_truthy
+ end
end
-
end
describe ".parse" do
let(:helper) { MetricFu::Cli::Helper.new }
@@ -120,11 +116,10 @@
expect(helper.process_options(["--cane"])[:cane]).to be_truthy
end
end
-
it "turns hotspots off" do
expect(helper.process_options(["--no-hotspots"])[:hotspots]).to be_falsey
end
it "turns hotspots on" do
@@ -155,18 +150,16 @@
expect(helper.process_options(["--roodi"])[:roodi]).to be_truthy
end
context "given a single format" do
it "sets the format" do
- expect(helper.process_options(["--format", "json"])[:format]).to eq([['json']])
+ expect(helper.process_options(["--format", "json"])[:format]).to eq([["json"]])
end
end
context "given multiple formats" do
it "sets multiple formats" do
- expect(helper.process_options(["--format", "json", "--format", "yaml"])[:format]).to eq([['json'], ['yaml']])
+ expect(helper.process_options(["--format", "json", "--format", "yaml"])[:format]).to eq([["json"], ["yaml"]])
end
end
-
end
-
end