Sha256: de32e61a2bfe657ebc8c860629d8bcedbf0b4b8da2f7314af65fd525eb5e57a2

Contents?: true

Size: 560 Bytes

Versions: 15

Compression:

Stored size: 560 Bytes

Contents

require 'test/unit'

require File.expand_path('../../lib/rockstar', __FILE__)
require File.expand_path('..//mocks/rest', __FILE__)

class << Test::Unit::TestCase
  def test(name, &block)
    test_name = :"test_#{name.gsub(' ','_')}"
    raise ArgumentError, "#{test_name} is already defined" if self.instance_methods.include? test_name.to_s
    define_method test_name, &block
  end
  
  def expect(expected_value, &block)
    define_method :"test_#{caller.first.split("/").last}" do
      assert_equal expected_value, instance_eval(&block)
    end 
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rockstar-0.8.1 test/test_helper.rb
rockstar-0.8.0 test/test_helper.rb
jonaustin-rockstar-0.7.1 test/test_helper.rb
rockstar-0.7.1 test/test_helper.rb
rockstar-0.7.0 test/test_helper.rb
rockstar-0.6.4 test/test_helper.rb
rockstar-0.6.3 test/test_helper.rb
rockstar-0.6.2 test/test_helper.rb
rockstar-custom-0.6.1 test/test_helper.rb
rockstar-0.6.0 test/test_helper.rb
rockstar-0.5.2 test/test_helper.rb
rockstar-0.5.1 test/test_helper.rb
rockstar-0.5.0 test/test_helper.rb
rockstar-0.4.2 test/test_helper.rb
rockstar-0.4.1 test/test_helper.rb