Skip to content

Commit

Permalink
Fix deprecations in tests
Browse files Browse the repository at this point in the history
I was getting

```
DEPRECATED: global use of wont_match from ./sdoc/spec/rdoc_generator_spec.rb:37. Use _(obj).wont_match instead. This will fail in Minitest 6.
```
  • Loading branch information
mikdiet committed Apr 18, 2021
1 parent f5d5d8f commit 7bf9214
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions spec/helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
]

strings.each do |(html, stripped)|
@helpers.strip_tags(html).must_equal stripped
_(@helpers.strip_tags(html)).must_equal stripped
end
end
end

describe "#truncate" do
it "should truncate the given text around a given length" do
@helpers.truncate("Hello world", length: 5).must_equal "Hello."
_(@helpers.truncate("Hello world", length: 5)).must_equal "Hello."
end
end
end
18 changes: 9 additions & 9 deletions spec/rdoc_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
end

it "should find sdoc generator" do
RDoc::RDoc::GENERATORS.must_include 'sdoc'
_(RDoc::RDoc::GENERATORS).must_include 'sdoc'
end

it "should use sdoc generator" do
@options.generator.must_equal RDoc::Generator::SDoc
@options.generator_name.must_equal 'sdoc'
_(@options.generator).must_equal RDoc::Generator::SDoc
_(@options.generator_name).must_equal 'sdoc'
end

it "should parse github option" do
Expand All @@ -23,8 +23,8 @@
@parser.parse %w[--github]
end

err.wont_match(/^invalid options/)
@options.github.must_equal true
_(err).wont_match(/^invalid options/)
_(@options.github).must_equal true
end

it "should parse github short-hand option" do
Expand All @@ -34,15 +34,15 @@
@parser.parse %w[-g]
end

err.wont_match(/^invalid options/)
@options.github.must_equal true
_(err).wont_match(/^invalid options/)
_(@options.github).must_equal true
end

it "should display SDoc version on -v or --version" do
out_full = `./bin/sdoc --version`
out_short = `./bin/sdoc -v`

out_short.strip.must_equal SDoc::VERSION
out_full.strip.must_equal SDoc::VERSION
_(out_short.strip).must_equal SDoc::VERSION
_(out_full.strip).must_equal SDoc::VERSION
end
end

0 comments on commit 7bf9214

Please sign in to comment.