
Security News
ESLint Adds Support for Parallel Linting, Closing 10-Year-Old Feature Request
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
tunit
is my take on building a testing framework, it's heavily influenced by
minitest.
NOTE This is very unstable and is just a playground for my ideas.
Since this is heavily influenced by Ryan Davis' minitest there are a lot of similarities between the two frameworks.
I wanted to see how much code and effort are needed to build a testing framework of my own, while looking at the learnings of minitest.
I personally love TDD frameworks like minitest, so I tried to mimic their behaviour and patterns as close as I possibly could. As with minitest, this is just plain ruby.
class BlahTest < Tunit::Test
def setup
self.blah = Blah.new
end
attr_accessor :blah
def test_the_answer_to_everything
assert_equal 42, blah.the_ultimate_answer
end
def test_packing_list
assert_includes blah.packing_list, "towel"
end
def test_that_will_be_skipped
skip "test this later"
end
end
What's important to me is that BlahTest
is just a simple subclass, and
test_the_answer_to_everything
is a simple method. Assertions and
lazily-loaded variables are just methods, everything is just a simple method
definition away.
I'm a strong believer in that you should only mock and stub things so you can
assert on something else. That's why a test
-method must have assertions in
tunit
class EmptyTest < Tunit::Test
def test_im_going_to_fail
end
def test_so_will_i
1 + 1 == 2
end
end
There is also a small Spec DSL that follows along with tunit
require 'tunit/autorun'
Example = Class.new
describe Example do
describe 'passing tests' do
it 'even' do
assert 2.even?
end
it 'passed once more' do
assert_includes [1, 2], 2
end
end
describe 'failing tests' do
it 'fails on empty tests' do
end
it 'fails hard' do
refute 2.even?
end
end
describe 'skipps' do
it 'skippedy skip' do
skip
end
it 'skips with a message' do
skip 'here!'
end
end
end
That's it, no magic let's or subjects. Just it
and describe
blocks
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that tunit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.