spec/cli_spec.rb in fukuzatsu-1.0.6 vs spec/cli_spec.rb in fukuzatsu-2.1.1
- old
+ new
@@ -1,48 +1,15 @@
require 'spec_helper'
-describe "Fukuzatsu::CLI" do
+describe Fukuzatsu::CLI do
- let(:cli) { Fukuzatsu::CLI.new([
- path: "foo/bar.rb",
- format: 'text'
- ]
- )}
+ let(:cli) { Fukuzatsu::CLI.new }
- let(:summary_1) {
- {
- results_file: "doc/fukuzatsu/file_1.rb.htm",
- path_to_file: "file_1.rb",
- class_name: "File_1",
- complexity: 13
- }
- }
-
- let(:summary_2) {
- {
- results_file: "doc/fukuzatsu/file_2.rb.htm",
- path_to_file: "file_2.rb",
- class_name: "File_2",
- complexity: 11
- }
- }
-
- before do
- allow(cli).to receive(:summaries) { [summary_1, summary_2] }
- end
-
- describe "#formatter" do
- it "returns a csv formatter" do
- allow(cli).to receive(:options) { {'format' => 'csv'} }
- expect(cli.send(:formatter)).to eq Formatters::Csv
+ describe "#check" do
+ it "invokes Fukuzatsu" do
+ expect(Fukuzatsu).to receive(:new) { Struct.new(:report).new("OK") }
+ cli.check("./fixtures")
end
- it "returns an html formatter" do
- allow(cli).to receive(:options) { {'format' => 'html'} }
- expect(cli.send(:formatter)).to eq Formatters::Html
- end
- it "returns a text formatter" do
- allow(cli).to receive(:options) { {'format' => 'text'} }
- expect(cli.send(:formatter)).to eq Formatters::Text
- end
end
end
+