File: tests_helper.rb

package info (click to toggle)
ruby-shindo 0.3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 224 kB
  • sloc: ruby: 456; makefile: 14
file content (26 lines) | stat: -rw-r--r-- 564 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
24
25
26
require 'shindo'
require 'open3'

BIN = File.join(File.dirname(__FILE__), '..', 'bin', 'shindo')

def bin(arguments)
  `RUBYOPT="-rrubygems" #{BIN} #{arguments}`
end

def path(name)
  File.join(File.dirname(__FILE__), 'data', name)
end

module Shindo
  class Tests

    def includes(expectation, description = "includes #{expectation.inspect}", &block)
      test(description) do
        value = instance_eval(&block)
        @message = "expected #{value.inspect} to include #{expectation.inspect}"
        value.include?(expectation)
      end
    end

  end
end