Coder Social home page Coder Social logo

videostore's Introduction

Video Store refactoring exercise in ruby

This repo is the starting point of Martin Fowler's videostore refactoring example in Ruby. The following requirements have already been implemented.

A customer can printout his statement. On the statement must appear:

  • The customer's name
  • Each movie he rents, with its price
  • The total amount owed
  • The frequent renter points he's earned

For each movie category, some rules apply.

Regular movies:

  • amount is $2.00 for the first 2 days
  • an extra $1.50 is added for each additional day
  • you get 1 frequent renter point

New releases:

  • amount is $3.00 per day rented
  • you get 1 frequent renter point for the first day
  • you get 1 extra frequent renter point if you rent more than a day

Children's movies:

  • amount is $1.50 for the first 3 days
  • an extra $1.50 is added for each additional day
  • you get 1 frequent renter point

Challenge

Refactor the existing code for the following new requirements:

  • print an HTML customer statement.
  • add an extra category with it's own rules

Setup

Unless you don't want to test during refactoring, you probably want to install rspec and ZenTest. Run 'gem install rspec ZenTest'. To start to test continuously, simply type 'autotest' in the root of this project.

Mac usrers might want to run 'gem install autotest-growl autotest-fsevent'

videostore's People

Contributors

michelgrootjans 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.