Sha256: a2053f51c96d8f92a39b950a4df8732800799e245c6303f4f19f4b0516153c13

Contents?: true

Size: 858 Bytes

Versions: 2

Compression:

Stored size: 858 Bytes

Contents

rgot
===

[![Build Status](https://travis-ci.org/ksss/rgot.svg)](https://travis-ci.org/ksss/rgot)

RGOT is a Ruby Golang like Testing package.

### usage

test/sample.rb
```ruby
class Sample
  def sum(i, j)
    i + j
  end
end
```

test/pass_test.rb
```ruby
require_relative './sample'

module SampleTest
  class TypeSum < Struct.new(:left, :right, :expect)
  end

  DATA = [
    TypeSum.new(2, 3, 5),
    TypeSum.new(12, 9, 21),
    TypeSum.new(85, 42, 127),
  ]

  def test_pass(t)
    s = Sample.new
    DATA.each do |ts|
      sum = s.sum(ts.left, ts.right)
      unless sum.kind_of?(Fixnum)
        t.error("expect Fixnum got #{sum.class}")
      end
      unless sum == ts.expect
        t.error("expect 5 got #{sum}")
      end
    end
  end
end
```

```
$ rgot -v test/pass_test.rb
=== RUN test_pass
--- PASS: test_pass (0.00003s)
PASS
ok	0.001s
```

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rgot-0.0.2 README.md
rgot-0.0.1 README.md