README.md in assert-2.4.0 vs README.md in assert-2.5.0
- old
+ new
@@ -9,26 +9,26 @@
require 'assert'
class MyTests < Assert::Context
- def test_something
+ test "something" do
assert_equal 1, 1
end
end
```
-```sh
+```
$ assert test/my_tests.rb
Loaded suite (1 test)
-Running tests in random order, seeded with "33650"
+Running tests in random order, seeded with "56382"
.
1 result: pass
-(0.000199 seconds)
+(0.000128 seconds, 7812.500000 tests/s, 7812.500000 results/s)
```
## What Assert is
* **Framework**: you define tests and the context they run in - Assert runs them. Everything is pure ruby so use any 3rd party testing tools you like. Create 3rd party tools that extend Assert behavior.
@@ -224,15 +224,15 @@
git ls-files --others --exclude-standard # added files
```
The git cmds have ` -- #{test_paths}` appended to them to scope their results to just the test paths specified by the CLI and are run together using ` && `.
-This, of course, assumes you are working in a git repository. If you are not or you want to use custom logic to determine the changed files, configure a custom proc. The proc should take a single parameter which is an array of test paths specified by the CLI.
+This, of course, assumes you are working in a git repository. If you are not or you want to use custom logic to determine the changed files, configure a custom proc. The proc should take two parameters: the config and an array of test paths specified by the CLI.
```ruby
Assert.configure do |config|
- config.changed_files do |test_paths|
+ config.changed_proc Proc.new do |config, test_paths|
`git diff --name-only master -- #{test_paths.join(' ')}`.split("\n") # or whatever
end
end
```
@@ -240,13 +240,13 @@
```ruby
Assert.configure do |config|
# run nothing if the `-c` flag is given
- config.changed_files{ |test_paths| [] }
+ config.changed_proc Proc.new{ |test_paths| [] }
# run all test paths if the `-c` flag is given
- config.changed_files{ |test_paths| test_paths }
+ config.changed_proc Proc.new{ |test_paths| test_paths }
end
```
### Pretty Printing values in fail messages