Giter Club home page Giter Club logo

git-book-fizzbuzz's Introduction

Advanced Git: Forking Workflow Sample Project

This is the sample project for the Forking Workflow chapter of the RayWenderlich Advanced Git book.

git-book-fizzbuzz's People

Contributors

jawwad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

git-book-fizzbuzz's Issues

The feature for using alternate divisors (other than 3 and 5) does not work

Note: This is an exercise for the Forking Workflow chapter of the RayWenderlich Mastering Git Book

In 85ca623 a feature was added to allow divisors other than 3 and 5 to be used for Fizz and Buzz. However, this feature does not work since the parameters added to the method signature were not actually used anywhere in the code.

In the following block of code lines 6 and 8 were the ones that were added. However, lines 11 and 12 were never updated to actually use these new parameters. The 3 in line 11 should have been updated to use fizz_divisor and the 5 in line 12 should have been updated to use buzz_divisor.

https://github.com/raywenderlich/git-book-fizzbuzz/blob/85ca623d39b416a78fe97d61a27cfa46b8a4755e/fizzbuzz.py#L4-L13

The following test was added as part of the same commit but it looks like the test may not have been run since it is currently failing.
https://github.com/raywenderlich/git-book-fizzbuzz/blob/85ca623d39b416a78fe97d61a27cfa46b8a4755e/test_fizzbuzz.py#L37-L45

I receive the following output if I run the tests via python test_fizzbuzz.py. Instead of printing Fizz for 7, Buzz for 11 and FizzBuzz for 77 it just prints the numbers:

test_divisible_by_both (__main__.TestFizzBuzz) ... ok
test_divisible_by_five (__main__.TestFizzBuzz) ... ok
test_divisible_by_none (__main__.TestFizzBuzz) ... ok
test_divisible_by_three (__main__.TestFizzBuzz) ... ok
test_with_alternate_divisors (__main__.TestFizzBuzz) ... test_with_alternate_words (__main__.TestFizzBuzz) ... ok

======================================================================
FAIL: test_with_alternate_divisors (__main__.TestFizzBuzz) [Alternate Divisors: Divisible by First]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test_fizzbuzz.py", line 41, in test_with_alternate_divisors
    self.assertEqual(fizzbuzz_for_num(7, fizz_divisor=7, buzz_divisor=11), "Fizz")
AssertionError: '7' != 'Fizz'
- 7
+ Fizz


======================================================================
FAIL: test_with_alternate_divisors (__main__.TestFizzBuzz) [Alternate Divisors: Divisible by Second]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test_fizzbuzz.py", line 43, in test_with_alternate_divisors
    self.assertEqual(fizzbuzz_for_num(11, fizz_divisor=7, buzz_divisor=11), "Buzz")
AssertionError: '11' != 'Buzz'
- 11
+ Buzz


======================================================================
FAIL: test_with_alternate_divisors (__main__.TestFizzBuzz) [Alternate Divisors: Divisible by Both]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test_fizzbuzz.py", line 45, in test_with_alternate_divisors
    self.assertEqual(fizzbuzz_for_num(77, fizz_divisor=7, buzz_divisor=11), "FizzBuzz")
AssertionError: '77' != 'FizzBuzz'
- 77
+ FizzBuzz


----------------------------------------------------------------------
Ran 6 tests in 0.001s

FAILED (failures=3)

Can someone submit a pull request to fix this issue?

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.