8000 GitHub - eddorre/ruby_tools: A collection of Ruby tools that I use sometimes
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

eddorre/ruby_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

For when I don't to include a whole testing framework just to test some Ruby code.

Usage

git clone git@github.com:eddorre/ruby_tools.git ~/.ruby_tools

In your Ruby code:

require '~/.ruby_tools/simple_spec.rb'
include Eddorre::SimpleSpec

# Note that describe can be used instead of test (just in case I got RSpec on the brain)

### Running the test on the library
ruby '~/.ruby_tools/spec.rb'

### Checking for equality
test 'it should return two' do
  expect(1 + 1).to eq(2)
end

### Checking for truthiness
test 'it should return true' do
  expect { 1 + 1 == 2 }.to be_truthy
end

### Check for falsey-ness
test 'it should return true' do
  expect { 1 + 2 == 3 }.to be_falsey
end

### Skip a test, the expectation won't be evaluated and a message that the test is skipped is output
xtest 'it should be skipped' do
  expect(1 + 1).to eq(2)
end

About

A collection of Ruby tools that I use sometimes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0