Skip to content

Commit

Permalink
Add coverage test that utilizes options parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
KaanOzkan committed Jan 24, 2025
1 parent dac0d85 commit e2518a0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/spoom/cli/srb/coverage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,41 @@ def test_finish_on_original_branch
assert_equal("fake-branch", @project.git_current_branch)
end

def test_config_options_string
# Add ignore path to config to test config options string
@project.write!("sorbet/config", "\n--ignore=lib/a.rb\n--ignore=*.rb", append: true)

result = @project.spoom("srb coverage snapshot")
out = censor_sorbet_version(result.out)
assert_equal(<<~MSG, out)
Sorbet static: X.X.XXXX
Sorbet runtime: X.X.XXXX
Content:
files: 3
files excluding rbis: 2
modules: 3
classes: 1
methods: 9
methods excluding rbis: 9
Sigils:
true: 3 (100%)
Methods:
with signature: 2 (22%)
without signature: 7 (78%)
Methods excluding RBIs
with signature: 2 (22%)
without signature: 7 (78%)
Calls:
typed: 4 (67%)
untyped: 2 (33%)
MSG
end

private

def create_git_history!
Expand Down

0 comments on commit e2518a0

Please sign in to comment.