Git Product home page Git Product logo

romanic_testing's Introduction

romanic_testing

Overview

This was originally a simple gem I wrote a while back called romanic that handles roman numerals and eventually posted online. I've posted this variation of it on github now because I used it as an example of basic Ruby testing in 67-272 in the spring of 2014. There are two branches: master (which passes all the tests) and flawed (which ad-hoc testing seems to say is fine, but the full test suite finds a flaw).

Romanic explained

The romanic module has two sub-modules: RomanicIntegers and RomanicStrings. The RomanicIntegers is designed a to_roman method to Ruby's Fixnum class. This would allow you to write 14.to_roman and get back 'XIV' as a string. The RomanicStrings is designed a from_roman method to Ruby's String class. This would allow you to write XIV.to_roman and get back the number 14. If the value is out-of-bounds (less than 1, 5000 or greater) or just isn't a romanic string ('bad') then nil is returned.

Getting the gem

If you want to really use the functionality (not that Roman numeral conversions are a high demand operation, but who knows what nefarious purposes you could use it for), installing this gem is pretty simple -- just type on the command line:

$ gem install romanic 

And add this gem into any other code with:

require 'romanic' 

Qapla'

Prof. H

February 2014

romanic_testing's People

Contributors

profh avatar

Watchers

 avatar James Cloos avatar Prof. Gongora-Svartzman (Prof. GS) avatar Prof. Houda Bouamor avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.