Skip to content

Commit

Permalink
ready for automation and user stories
Browse files Browse the repository at this point in the history
  • Loading branch information
tansaku committed Mar 26, 2015
1 parent a8e533f commit 3e3bbdc
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/**/.DS_Store
/coverage
2 changes: 2 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruby:
config_file: .rubocop.yml
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color --format documentation
--require spec_helper
42 changes: 42 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
require: rubocop-rspec

EmptyLinesAroundBlockBody:
Enabled: false

Style/StringLiterals:
Enabled: false

Style/Documentation:
Description: Document classes and non-namespace modules.
Enabled: false

Style/MethodDefParentheses:
Description: Checks if the method definitions have or don't have parentheses.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
Enabled: false

Style/SingleLineBlockParams:
Description: Enforces the names of some block params.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
Enabled: false
Methods:
- reduce:
- a
- e
- inject:
- a
- e

Lint/UselessAssignment:
Description: Checks for useless assignment to a local variable.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
Enabled: false

Style/TrailingBlankLines:
Description: Checks trailing blank lines and final newline.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
Enabled: false
EnforcedStyle: final_newline
SupportedStyles:
- final_newline
- final_blank_line
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
script: bundle exec rspec spec
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,37 @@ Task

* Fill out your learning plan self review for the week: https://github.com/makersacademy/learning_plan (if you haven't already)
* Fork this repo
* Write a Takeaway program.
* Implement the following functionality:
* list of dishes with prices
* placing the order by giving the list of dishes, their quantities and a number that should be the exact total. If the sum is not correct the method should raise an error, otherwise the customer is sent a text saying that the order was placed successfully and that it will be delivered 1 hour from now, e.g. "Thank you! Your order was placed and will be delivered before 18:52".
* Write a Takeaway program with the following user stories:

```sh
As a customer
So that I can check if I want to order something
I would like to see a list of dishes with prices

As a customer
So that I can order the meal I want
I would like to be able to select some number of several available dishes

As a customer
So that I can verify that my order is correct
I would like to check that the total I have been given matches the sum of the various dishes in my order

As a customer
So that I am reassured that my order will be delivered on time
I would like to receive a text such as "Thank you! Your order was placed and will be delivered before 18:52" after I have ordered
```
* Hints on functionality to implement:
* ensure you have a list of dishes with prices
* place the order by giving the list of dishes, their quantities and a number that should be the exact total. If the sum is not correct the method should raise an error, otherwise the customer is sent a text saying that the order was placed successfully and that it will be delivered 1 hour from now, e.g. "Thank you! Your order was placed and will be delivered before 18:52".
* The text sending functionality should be implemented using Twilio API. You'll need to register for it. It’s free.
* Use twilio-ruby gem to access the API
* Use the twilio-ruby gem to access the API
* Use a Gemfile to manage your gems
* Make sure that your Takeaway is thoroughly tested and that you use mocks and/or stubs, as necessary to not to send texts when your tests are run
* However, if your Takeaway is loaded into IRB and the order is placed, the text should actually be sent
* A free account on Twilio will only allow you to send texts to "verified" numbers. Use your mobile phone number, don't worry about the customer's mobile phone.
* Finally submit a pull request before Monday at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday at 9am

**Note: We are looking for good OO design and programming! Remember the Single Responsibility and Dependency Injection/Inversion principles!**
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'rubocop/rake_task'
require 'rspec/core/rake_task'

RuboCop::RakeTask.new :cop
RSpec::Core::RakeTask.new :spec

task default: [:cop, :spec]
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'coveralls'
Coveralls.wear!

0 comments on commit 3e3bbdc

Please sign in to comment.