Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-simpletest
Simple Test Using assert
https://github.com/matsumotory/mruby-simpletest
Last synced: about 2 months ago
JSON representation
Simple Test Using assert
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-simpletest
- Owner: matsumotory
- License: other
- Created: 2014-08-26T15:03:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-28T13:32:29.000Z (about 5 years ago)
- Last Synced: 2024-10-18T18:22:20.714Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-simpletest [![Build Status](https://travis-ci.org/matsumoto-r/mruby-simpletest.svg?branch=master)](https://travis-ci.org/matsumoto-r/mruby-simpletest)
SimpleTest class
## install by mrbgems
- add conf.gem line to `build_config.rb````ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :git => 'https://github.com/matsumoto-r/mruby-simpletest.git'
end
```
## example
### Test Code
```ruby
t = SimpleTest.new "Test Example1"t.assert "test1" do
t.assert_equal "echo", "echo"
t.assert_equal "ech", "ech"
endt.assert "test2" do
t.assert_equal "hoge", "hoge"
t.assert_not_equal "hoge", "foo"
t.assert_true true
t.assert_false false
endt.report
s = SimpleTest.new "Test Example2"
s.assert "test1" do
s.assert_equal "echo", "echo"
s.assert_equal "ech", "ech"
ends.report
```
### Result
```
$ ./bin/mruby test.rb
SimpleTest: Test Example1
..
Total: 2
OK: 2
KO: 0
Crash: 0
Time: 0.0005770 secondsSimpleTest: Test Example2
.
Total: 1
OK: 1
KO: 0
Crash: 0
Time: 0.0000330 seconds```
## License
under the MIT License:
- see LICENSE file