File: helpers.rb

package info (click to toggle)
ruby-rsec 0.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 272 kB
  • sloc: ruby: 2,130; lisp: 13; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# coding: utf-8

$:.unshift "#{File.dirname(__FILE__)}/../lib"
require "rsec"
include Rsec::Helpers
require "test/unit"

TC = Test::Unit::TestCase
class TC
  INVALID = Rsec::INVALID
end

module Test::Unit::Assertions
  alias ase assert_equal
  def asr
    assert_raise(Rsec::SyntaxError) { yield }
  end
  # assert parse returns s
  def asp s, p
    assert_equal(s, p.parse(s))
  end
end