Skip to content

Commit

Permalink
✅ More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Sep 17, 2024
1 parent bcc4bd7 commit 96707ac
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export K_SOUP_COV_DO=true # Means you want code coverage
# Available formats are html, xml, rcov, lcov, json, tty
export K_SOUP_COV_COMMAND_NAME="RSpec Coverage"
export K_SOUP_COV_FORMATTERS="html,tty"
export K_SOUP_COV_MIN_BRANCH=44 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=64 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_BRANCH=57 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=81 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
export K_SOUP_COV_MULTI_FORMATTERS=true
export MAX_ROWS=5 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Code Coverage

env:
K_SOUP_COV_MIN_BRANCH: 44
K_SOUP_COV_MIN_LINE: 64
K_SOUP_COV_MIN_BRANCH: 57
K_SOUP_COV_MIN_LINE: 81
K_SOUP_COV_MIN_HARD: true
K_SOUP_COV_DO: true
K_SOUP_COV_COMMAND_NAME: "MiniTest Coverage"
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
hide_complexity: true
indicators: true
output: both
thresholds: '64 44'
thresholds: '81 57'
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Add Coverage PR Comment
Expand Down
4 changes: 4 additions & 0 deletions spec/gem_bench/version_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
RSpec.describe GemBench::Version do
it_behaves_like "a Version module", described_class

it "is greater than 1.0.0" do
expect(Gem::Version.new(described_class) >= Gem::Version.new("1.0.0")).to be(true)
end
end
42 changes: 36 additions & 6 deletions spec/gem_bench_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
RSpec.describe GemBench::Version do
it_behaves_like "a Version module", described_class
RSpec.describe GemBench do
describe "::check" do
subject(:check) { described_class.check(**opts) }

it "is greater than 0.1.0" do
expect(Gem::Version.new(described_class) > Gem::Version.new("0.1.0")).to be(true)
let(:opts) { {} }

it "succeeds" do
block_is_expected.to not_raise_error
end
end

describe "::versions_present?" do
subject(:versions_present) { described_class.versions_present?(**opts) }

let(:opts) { {} }

it "succeeds" do
block_is_expected.to not_raise_error
end
end

it "is greater than 1.0.0" do
expect(Gem::Version.new(described_class) >= Gem::Version.new("1.0.0")).to be(true)
describe "::list_missing_version_constraints" do
subject(:list_missing_version_constraints) { described_class.list_missing_version_constraints(**opts) }

let(:opts) { {} }

it "succeeds" do
block_is_expected.to not_raise_error
end
end

describe "::find" do
subject(:find) { described_class.find(**opts) }

let(:opts) { {} }

it "succeeds" do
block_is_expected.to not_raise_error
end
end
end

0 comments on commit 96707ac

Please sign in to comment.