Pork.show_source
can work under frozen literal string mode now.- Fix picking the right test for the file line number from
ENV['PORK_TEST']
(I totally forgot the details for this from 2017, but I think it should make it more accurate anyway) - Ruby 3.2 compatibility fix. (Removed the use of
Random::DEFAULT
)
- Introduced
Pork::API.around
which will pass the test object to the block, and whenever the object is called withcall
it'll run the test. Note that ifcall
was never called, it'll act likePork::API.before
and the test will still run unlike RSpec. To skip the test, callskip
directly.
Pork::Executor
is now renamed toPork::Suite
, and the newPork::Executor
would be served as the real executor who's responsible for running the test suites!Pork::Executor.execute
would now take a hash as the argument.Pork::Suite.after
would now run in a reverse manner because that would serve better as a destructor.
Pork::Suite.desc
would now preserve the original argument being passed toPork::Suite.describe
, rather than converting it to a string.- Major internal structure cleanup. Now we don't include everything into the
context, but use different objects to do different things. For example,
now we have
Pork::Isolator
to isolate the context. - Introduced
Pork.execute_extensions
which would be extending toPork::Executor
. The only extension for it for now isPork::Should
. - Don't crash if
Pork.loaded
was never called. - Now you could also make assertions in
after
block without triggeringMissing assertions
errors.
- Now it would show loading time between pork was loaded and test started.
You could tweak the time by using
Pork.loaded
. - Pork in sequential mode would just use Isolate internally. This would reduce the internal complexity.
- Added
PORK_REPORT=progressbar
, usingruby-progressbar
underneath.
- Now
Pork.protected_exceptions
would not create stat object. We should not create it unless we're trying to run a test.
- Introduced
Pork.protected_exceptions
to protect exceptions aren't derived fromStandardError
. Check README for usage.
- Do not extend anything if no
report_extensions
was loaded.
- Introduced
Expect#approx
for comparing two floating point numbers.
- Removed the extra colon with PORK_REPORT=description.
- Introduced
Pork.report_mode
andENV['PORK_REPORT']
. - The replicating command for
ENV['PORK_SEED']
is more accurate now. - Now you can still run test sequentially when
ENV['PORK_TEST']
is set.
- Using
ENV['PORK_TEST']
to specify a describe block would run all before/after blocks properly now.
- Added
pork_description
in the test case so that we could access the description for the running test case. To access the full message, useself.class.send(:description_for, "would: #{pork_description}")
. Note that this is not a public API yet, and is subject to change.
Pork.run
is renamed toPork.execute
, andPork.run
would now do a full run.Pork::Executor.all_tests
would also include paths to describe blocks.
- Now
describe
could also take a second argument to specify groups. PORK_TEST
could also accept a file path and line number pointing to a describe block. Previously only would block would work.
Pork.show_source
would never raise SyntaxError anymore.
- Introduced
Pork.show_source
to print the source of failing tests. Using this feature requiresmethod_source
installed.
- Fixed a potential data race in parallel tests using
should
.
-
Now
would
could take a second argument with:groups => [:name]
, and you could also specifying the groups to run inPORK_TEST
. Checkout README for more information. Input from @mz026 -
PORK_TEST
could also accept a file path without a line number now.
- Show tests per second and assertions per second as in minitest.
- Fixed that sometimes it cannot find the test because source_location
sometimes won't use the full path. Always use
File.expand_path
then. - Properly strip pork backtrace.
- Mutant integration is removed for now. Please let me know if it could be integrated without a problem.
- Default mode changed to
:shuffled
, and the original mode renamed to:sequential
. - Running individual test changed from description to file:line_number. Input from @mz026
- Paths in backtrace would no longer use
.
to indicate current directory. Some editor such as Sublime didn't like it.
- Fixed exit status.
- Introduced
require 'pork/more'
for colored output and bottom-up backtrace. - Introduced
Pork.Rainbows!
for fun.
- Really fixed passing
ENV['PORK_MODE']=execute
. I should sleep now.
- Fixed passing
ENV['PORK_MODE']=execute
- Now we can interrupt the tests and still see current report.
- Use
exit!
inat_exit
to avoid issues. - Fixed the description order for nested test cases.
- Pork::Parallel.parallel API slightly changed.
- Pork::Isolate.isolate API slightly changed.
- Pork::Isolate.all_tests format changed.
- Mutant::Integration::Pork could be broken now... but it never really works.
- Accept
ENV['PORK_MODE']
forPork.execute_mode
- Accept
ENV['PORK_SEED']
for setting up srand. - Accept
ENV['PORK_TEST']
for running a particular test case. - For failure tests, it would now print the replicating command.
- Make backtrace easier to read by using
.
and~
. - Fix parallels mode to detect missing assertions properly.
- Slightly changed
Pork::Stat
. A kinda incompatible change, but usingPork::Stat
should be considered private.
- Fix
Kernel#should
compatibility for JRuby 1.7.18- and Ruby 2.2.0 by never assuming ThreadGroup#list would preserve the order.
- Hash difference is much improved. Now it uses
/
to separate keys, and use quotes for string keys and colons for symbol keys, so that we won't be confused when comparing string hashes and symbol hashes. Further more, it would show<undefined>
for hashes missing a key, and<out-of-bound>
for arrays out of bound. Previously, hash with nil values are indistinguishable with hash missing keys. Thanks Chun-Yi Liu (@trantorliu).
- Fixed the failure message for hash diff.
- Now exceptions raised in after hook are properly rescued.
- Previously runtime includes loading time, now it only includes test running time.
- Internal structure was completed rewritten.
- Simply
require 'pork'
would no longer introduceKernel#should
. Userequire 'pork/should'
to bring it back. (require 'pork/auto'
would already do this for you) - Removed
@__pork__desc__
(which is implementation detail anyway) - Renamed
Pork.report_at_exit
toPork.autorun
-
Pork.autorun
also accepts a flag to enable/disable autorun. -
Introduced
Pork::Expector#expect
to replaceKernel#should
-
Kernel#should
is now optional and a wrapper aroundPork::Expector#expect
-
Introduced
Pork::Inspect#diff_hash
. See README.md forPork.inspect_failure_mode
for detail. -
Introduced
Pork.execute_mode
. See README.md for detail -
Introduced
Pork::Isolate
which allows you to run a specific test. -
Introduced
Pork::Shuffle
which we could run tests in random order. See README.md forPork.execute_mode
for detail. -
Introduced
Pork::Parallel
which we could run tests in parallel. See README.md forPork.execute_mode
for detail. -
Introduced
Pork::Executor#pork_stat
to access the current stat from test. -
Introduced mutant integration.
- Pork::Error is now a StandardError instead of an Exception. We should all try to avoid using Exception directly, since we don't want to interferer with signal handling.
- It would now properly
exit(1)
when there's an error. - It would now properly search the stashes chain upon
paste
.
Kernel#should
now accepts a second argument for building messages lazily.Should#satisfy
now accepts a second argument for building messages lazily.- Introduced
Pork.inspect_failure_mode
to switch failure display mode. - Default
Pork.inspect_failure_mode
to:auto
, which would display failures accordingly.
- First serious release! Bunch of updates. Nearly complete.
- Birthday!