Skip to content

Commit

Permalink
Merge pull request #98 from fastruby/fix-analyzed-module-test
Browse files Browse the repository at this point in the history
Fix analyzed module test
  • Loading branch information
etagwerker committed Sep 20, 2022
2 parents b74fe97 + 1e052af commit 733dd4f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -61,7 +61,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -76,7 +76,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -91,7 +91,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -101,4 +101,4 @@ jobs:
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake
bundle exec rake
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## main [(unreleased)](https://github.com/fastruby/skunk/compare/v0.5.2...HEAD)

* <INSERT YOUR FEATURE OR BUGFIX HERE>
* [BUGFIX: Fix analized module test](https://github.com/fastruby/skunk/pull/98)

## v0.5.2 / 2022-04-27 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.1...v0.5.2)

* [FEATURE: Support more rubies](https://github.com/fastruby/skunk/pull/92)
Expand Down
2 changes: 1 addition & 1 deletion lib/skunk/cli/commands/status_reporter.rb
Expand Up @@ -75,7 +75,7 @@ def table_options
width = max.pathname.to_s.length + HEADINGS_WITHOUT_FILE_WIDTH
{
style: {
width: width # rubocop:disable Style/HashSyntax
width: width
}
}
end
Expand Down
2 changes: 0 additions & 2 deletions lib/skunk/cli/commands/status_sharer.rb
Expand Up @@ -38,7 +38,6 @@ def base_url
ENV["SHARE_URL"] || DEFAULT_URL
end

# rubocop:disable Style/HashSyntax
def json_summary
result = {
total_skunk_score: total_skunk_score,
Expand All @@ -56,7 +55,6 @@ def json_summary

result
end
# rubocop:enable Style/HashSyntax

def json_results
sorted_modules.map(&:to_hash)
Expand Down
2 changes: 1 addition & 1 deletion lib/skunk/cli/options/argv.rb
Expand Up @@ -37,7 +37,7 @@ def parse # rubocop:disable Metrics/MethodLength
end

def to_h
super.merge(output_filename: output_filename) # rubocop:disable Style/HashSyntax
super.merge(output_filename: output_filename)
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions lib/skunk/rubycritic/analysed_module.rb
Expand Up @@ -53,7 +53,6 @@ def churn_times_cost
# - coverage
#
# @return [Hash]
# rubocop:disable Style/HashSyntax
def to_hash
{
file: pathname.to_s,
Expand All @@ -64,6 +63,5 @@ def to_hash
coverage: coverage.round(2)
}
end
# rubocop:enable Style/HashSyntax
end
end
4 changes: 3 additions & 1 deletion test/lib/skunk/rubycritic/analysed_module_test.rb
Expand Up @@ -68,7 +68,9 @@
end

it "returns a hash with all the attributes and values" do
_(@analysed_module.to_hash).must_equal result
@analysed_module.stub(:churn, 5) do
_(@analysed_module.to_hash).must_equal result
end
end
end
end

0 comments on commit 733dd4f

Please sign in to comment.