Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    ivoire 0.2

    Download button

    Downloads: 91  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Julian Berman | More programs
    MIT/X Consortium Lic... / FREE
    November 29th, 2012, 20:07 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    ivoire description

    A simple RSpec-like wrapper and translator for unit testing

    ivoire is a RSpec-like library written in Python.

    Example

    ivoire features two operation modes: transform mode and standalone mode.

    from ivoire import describe


    class Calculator(object):
     def add(self, x, y):
     return x + y

     def divide(self, x, y):
     return x / y


    with describe(Calculator) as it:
     with it("adds two numbers") as test:
     calculator = Calculator()
     test.assertEqual(calculator.add(2, 4), 6)

     with it("divides two numbers") as test:
     calculator = Calculator()
     test.assertEqual(calculator.divide(8, 4), 2)

     with it("doesn't divide by zero") as test:
     calculator = Calculator()
     with test.assertRaises(ZeroDivisionError):
     calculator.divide(8, 0)

     with it("multiplies two numbers") as test:
     calculator = Calculator()
     test.assertEqual(calculator.multiply(2, 3), 6)


    Other examples can be found in the examples directory.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    RSpec-like wrapper | unit testing | Python library | Python | RSpec | wrapper

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM