Coder Social home page Coder Social logo

venue_2203's Introduction

Instructions

  • Fork this Repository.
  • Clone your forked repo.
  • Complete the activity below.
  • Push your solution to your repo.
  • Submit a Pull Request from your repo to this repo.
  • Put your name in your PR!

Iteration 1

For iteration 1, we have created all of the tests you will need. Unskip tests one by one (by removing skip) and make each test pass before moving on to the next test. The tests will model the following interaction pattern:

pry(main)> require './lib/venue'
#=> true

pry(main)> venue = Venue.new('Bluebird', 4)
=> #<Venue:0x00007fed7c11dbd8 @capacity=4, @name="Bluebird", @patrons=[]>

pry(main)> venue.name
=> "Bluebird"

pry(main)> venue.capacity
=> 4

pry(main)> venue.patrons
=> []

Iteration 2

For iteration 2, we have created all of the tests you will need. Unskip tests one by one, making each test pass before moving onto the the next test. The tests will model the interaction pattern below.

  • The method yell_at_patrons should return an array of patrons with their names in all caps.
pry(main)> require './lib/venue'
#=> true

pry(main)> venue = Venue.new('Bluebird', 4)
=> #<Venue:0x00007fed7c11dbd8 @capacity=4, @name="Bluebird", @patrons=[]>

pry(main)> venue.add_patron('Mike')
pry(main)> venue.add_patron('Megan')
pry(main)> venue.add_patron('Bob')

pry(main)> venue.patrons
=> ["Mike", "Megan", "Bob"]

pry(main)> venue.yell_at_patrons
=> ["MIKE", "MEGAN", "BOB"]

Iteration 3

Now, it is time for you to write your own tests! Follow the interaction pattern below to write one test, make that test pass, and move on to the next test. You will have, at minimum, one test per new method.

  • The method over_capacity will return true or false if the venue has more patrons than the capacity
pry(main)> require './lib/venue'
#=> true

pry(main)> venue = Venue.new('Bluebird', 4)
=> #<Venue:0x00007fed7c11dbd8 @capacity=4, @name="Bluebird", @patrons=[]>

pry(main)> venue.add_patron('Mike')
pry(main)> venue.add_patron('Megan')
pry(main)> venue.add_patron('Bob')

pry(main)> venue.over_capacity?
=> false

pry(main)> venue.add_patron('James')
pry(main)> venue.add_patron('Cat')

pry(main)> venue.over_capacity?
=> true

Iteration 4

Now, it is time for you to write your own tests! Follow the interaction pattern below to write one test, make that test pass, and move on to the next test. You will have, at minimum, one test per new method.

  • The kick_out method will continue to remove patrons from the venue until it is no longer over capacity.
pry(main)> require './lib/venue'
#=> true

pry(main)> venue = Venue.new('Bluebird', 4)
=> #<Venue:0x00007fed7c11dbd8 @capacity=4, @name="Bluebird", @patrons=[]>

pry(main)> venue.add_patron('Mike')
pry(main)> venue.add_patron('Megan')
pry(main)> venue.add_patron('Bob')
pry(main)> venue.add_patron('James')
pry(main)> venue.add_patron('Cat')

pry(main)> venue.kick_out

pry(main)> venue.over_capacity?
=> false

venue_2203's People

Contributors

caden-jarrett avatar cjsim89 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.