Skip to content

Commit 733dd4f

Browse files
authored
Merge pull request #98 from fastruby/fix-analyzed-module-test
Fix analyzed module test
2 parents b74fe97 + 1e052af commit 733dd4f

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v2
1818
- name: Setup Ruby
1919
uses: ruby/setup-ruby@v1
2020
with:
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232

3333
steps:
34-
- uses: actions/checkout@v1
34+
- uses: actions/checkout@v2
3535
- name: Setup Ruby
3636
uses: ruby/setup-ruby@v1
3737
with:
@@ -46,7 +46,7 @@ jobs:
4646
runs-on: ubuntu-latest
4747

4848
steps:
49-
- uses: actions/checkout@v1
49+
- uses: actions/checkout@v2
5050
- name: Setup Ruby
5151
uses: ruby/setup-ruby@v1
5252
with:
@@ -61,7 +61,7 @@ jobs:
6161
runs-on: ubuntu-latest
6262

6363
steps:
64-
- uses: actions/checkout@v1
64+
- uses: actions/checkout@v2
6565
- name: Setup Ruby
6666
uses: ruby/setup-ruby@v1
6767
with:
@@ -76,7 +76,7 @@ jobs:
7676
runs-on: ubuntu-latest
7777

7878
steps:
79-
- uses: actions/checkout@v1
79+
- uses: actions/checkout@v2
8080
- name: Setup Ruby
8181
uses: ruby/setup-ruby@v1
8282
with:
@@ -91,7 +91,7 @@ jobs:
9191
runs-on: ubuntu-latest
9292

9393
steps:
94-
- uses: actions/checkout@v1
94+
- uses: actions/checkout@v2
9595
- name: Setup Ruby
9696
uses: ruby/setup-ruby@v1
9797
with:
@@ -101,4 +101,4 @@ jobs:
101101
run: |
102102
gem install bundler
103103
bundle install --jobs 4 --retry 3
104-
bundle exec rake
104+
bundle exec rake

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## main [(unreleased)](https://github.com/fastruby/skunk/compare/v0.5.2...HEAD)
99

1010
* <INSERT YOUR FEATURE OR BUGFIX HERE>
11+
* [BUGFIX: Fix analized module test](https://github.com/fastruby/skunk/pull/98)
12+
1113
## v0.5.2 / 2022-04-27 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.1...v0.5.2)
1214

1315
* [FEATURE: Support more rubies](https://github.com/fastruby/skunk/pull/92)

lib/skunk/cli/commands/status_reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def table_options
7575
width = max.pathname.to_s.length + HEADINGS_WITHOUT_FILE_WIDTH
7676
{
7777
style: {
78-
width: width # rubocop:disable Style/HashSyntax
78+
width: width
7979
}
8080
}
8181
end

lib/skunk/cli/commands/status_sharer.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def base_url
3838
ENV["SHARE_URL"] || DEFAULT_URL
3939
end
4040

41-
# rubocop:disable Style/HashSyntax
4241
def json_summary
4342
result = {
4443
total_skunk_score: total_skunk_score,
@@ -56,7 +55,6 @@ def json_summary
5655

5756
result
5857
end
59-
# rubocop:enable Style/HashSyntax
6058

6159
def json_results
6260
sorted_modules.map(&:to_hash)

lib/skunk/cli/options/argv.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def parse # rubocop:disable Metrics/MethodLength
3737
end
3838

3939
def to_h
40-
super.merge(output_filename: output_filename) # rubocop:disable Style/HashSyntax
40+
super.merge(output_filename: output_filename)
4141
end
4242
end
4343
end

lib/skunk/rubycritic/analysed_module.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def churn_times_cost
5353
# - coverage
5454
#
5555
# @return [Hash]
56-
# rubocop:disable Style/HashSyntax
5756
def to_hash
5857
{
5958
file: pathname.to_s,
@@ -64,6 +63,5 @@ def to_hash
6463
coverage: coverage.round(2)
6564
}
6665
end
67-
# rubocop:enable Style/HashSyntax
6866
end
6967
end

test/lib/skunk/rubycritic/analysed_module_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868
end
6969

7070
it "returns a hash with all the attributes and values" do
71-
_(@analysed_module.to_hash).must_equal result
71+
@analysed_module.stub(:churn, 5) do
72+
_(@analysed_module.to_hash).must_equal result
73+
end
7274
end
7375
end
7476
end

0 commit comments

Comments
 (0)