|
2 | 2 |
|
3 | 3 | require "test_helper" |
4 | 4 |
|
5 | | -require "rubycritic/analysers_runner" |
6 | | -require "skunk/rubycritic/analysed_modules_collection" |
7 | 5 | require "skunk/commands/status_reporter" |
8 | 6 |
|
9 | 7 | describe Skunk::Command::StatusReporter do |
10 | | - let(:paths) { "samples/rubycritic" } |
11 | | - |
12 | 8 | describe "#update_status_message" do |
13 | | - let(:output) { File.read("test/samples/console_output.txt") } |
14 | 9 | let(:reporter) { Skunk::Command::StatusReporter.new({}) } |
15 | 10 |
|
16 | | - around do |example| |
17 | | - RubyCritic::Config.source_control_system = MockGit.new |
18 | | - runner = RubyCritic::AnalysersRunner.new(paths) |
19 | | - analysed_modules = runner.run |
20 | | - analysed_modules.each do |analysed_module| |
21 | | - def analysed_module.coverage |
22 | | - 100.0 |
23 | | - end |
24 | | - |
25 | | - def analysed_module.churn |
26 | | - 1 |
27 | | - end |
28 | | - end |
29 | | - |
30 | | - reporter.analysed_modules = analysed_modules |
31 | | - reporter.score = analysed_modules.score |
32 | | - example.call |
33 | | - end |
34 | | - |
35 | 11 | it "reports a simple status message" do |
36 | | - _(reporter.update_status_message).must_equal "Skunk analysis complete. Use --format console to see detailed output." |
| 12 | + _(reporter.update_status_message).must_equal "" |
37 | 13 | end |
38 | | - |
39 | | - context "When there's nested spec files" do |
40 | | - let(:paths) { "samples" } |
41 | | - it "reports a simple status message" do |
42 | | - _(reporter.update_status_message).must_equal "Skunk analysis complete. Use --format console to see detailed output." |
43 | | - end |
44 | | - end |
45 | | - end |
46 | | -end |
47 | | - |
48 | | -# A Mock Git class that returns always 1 for revisions_count |
49 | | -class MockGit < RubyCritic::SourceControlSystem::Git |
50 | | - def revisions_count(_) |
51 | | - 1 |
52 | 14 | end |
53 | 15 | end |
0 commit comments