Skip to content

Simple DSL for writing Ruby unit tests in Pidgin language. Built with plain Ruby

Notifications You must be signed in to change notification settings

ozone4real/pidgin-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pidgin-spec

Simple DSL for writing Ruby unit tests in Pidgin language. Developed with pure Ruby

Installation

To install run:

gem install pidgin_spec

Basic Usage

require 'pidgin_spec'

PidginSpec.describe 'Pidgin test' do
  num = 30
  describe "Multiplication test" do
    e_go "test say multiplication dey work" do
      # test for positive result with 'go'
      expect_say(num * 5).go dey_equal_to(150)
    end
  end
  describe 'Division Test' do
    e_go "test say division dey work" do
      # test for negative result with 'no_go'
      expect_say(num/ 5).no_go dey_equal_to(6)
    end
  end
  # test for primitive types
  describe "Type test" do
    e_go "test say the type correct" do
      str = "I am a boy"
      expect_say(str.split(' ')).go be(Array)
    end
  end
  
  # test for an array or string that ends with certain values/characters
  describe "Ends with test" do
    e_go "test say array or string go end with some kine values" do
      expect_say([2, 3, 8, 20, 15]).go end_with(20, 15)
      expect_say("Pidgin_test).go end_with('ast')
    end
  end
end

Output of the above tests tests output

Run the test file with ruby test_file.rb

About

Simple DSL for writing Ruby unit tests in Pidgin language. Built with plain Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages