Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

DSL wrapper for the test/unit #This project is expired

tag: test-declare-0…

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 History.md
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Manifest.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 test-declare.gemspec
README.md

test-declare

DSL wrapper for the "test/unit".

Feature

  • Short and Small DSL, But he is a nosey helper :).
  • Nest, Nest, Nest...

Usage

Overview

# Product Code
class Person

  attr_reader :name, :birth

  def initialize(name)
    @name = name
    @birth = Time.now
  end

end

# Test Code
require 'test/declare'

The Person.new('John') do |john|
  is_a Person
  kind_of Object

  The john.name do
    kind_of String
    is_a String
    is 'Taro' # failure
    match /J/
  end

  The john.birth do
    kind_of Time
  end
end
  1) Failure:
test_"John"_is_"Taro" #bidirectional(#<Class:0x91f5690>)
<"Taro"> expected but was
<"John">.

7 tests, 12 assertions, 1 failures, 0 errors, 0 skips

Requirements

  • Ruby 1.9.2 or later

Install

$ gem install test-declare

Link

License

The MIT X License

Copyright (c) 2012 Kenichi Kamiya

See the file LICENSE for further details.

Something went wrong with that request. Please try again.