spec/tailor/cli_spec.rb in tailor-1.0.0.alpha2 vs spec/tailor/cli_spec.rb in tailor-1.0.0
- old
+ new
@@ -6,11 +6,11 @@
let(:args) { [] }
let(:options) { double "Options", show_config: false }
let(:config) do
double "Tailor::Configuration",
- file_sets: nil, formatters: nil
+ file_sets: nil, formatters: nil, load!: nil
end
before do
Tailor::Configuration.stub(:new).and_return config
Tailor::Critic.stub(:new)
@@ -32,11 +32,11 @@
end
end
describe "#initialize" do
let(:args) { ['last'] }
-
+
it "uses Options to parse the args" do
Tailor::Configuration.stub(:new).and_return config
Tailor::Critic.stub(:new)
Tailor::Reporter.stub(:new)
Tailor::CLI::Options.should_receive(:parse!).with(args).and_return options
@@ -50,19 +50,18 @@
with(args, options).and_return config
Tailor::Critic.stub(:new)
Tailor::CLI.new(args)
end
-
+
context "options.show_config is true" do
-
+
end
-
+
context "options.show_config is false" do
-
+
end
-
end
describe "#execute!" do
let(:reporter) { double "Tailor::Reporter" }
let(:critic) { double "Tailor::Critic", problem_count: 0 }
@@ -71,11 +70,11 @@
Tailor::Critic.stub(:new).and_return(critic)
Tailor::Reporter.stub(:new).and_return(reporter)
subject.instance_variable_set(:@critic, critic)
subject.instance_variable_set(:@reporter, reporter)
end
-
+
after do
Tailor::Critic.unstub(:new)
Tailor::Reporter.unstub(:new)
end
@@ -85,10 +84,10 @@
critic.stub(:problem_count).and_return 1
critic.stub(:problems)
critic.stub(:critique).and_yield(problems_for_file, label)
reporter.stub(:summary_report)
reporter.should_receive(:file_report).with(problems_for_file, label)
-
+
subject.execute!
end
end
end