Skip to content

Instantly share code, notes, and snippets.

View NicoleCarpenter's full-sized avatar

Nicole Carpenter NicoleCarpenter

View GitHub Profile
SELECT everything.id,
actual_event_id,
expected_event_id,
everything.policy_reference,
provider_order_number,
requirement_name,
status_event_type_code,
status_event_name,
status_event_detail,
flex_status,
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=2502086.94..2502095.57 ro

Basic TDD Flow with rspec

To create a new project with rspec, begin from the the project's root directory and install the rspec gem:

gem install rspec

Create a folder in this root directory called spec where we will house all of your test files. cd into this folder and create a file called reverser_spec.rb. Let's write our first test:

Testing Issues on Http Server

  • ServerTest - Stuck in the loop, gets all of the way to the end of the loop after thread.start() but does not return to while condition, where I was stubbing value to end the loop.
  • HttpFileIOTest - Using absolute values, need to be able to assign root relatively for tests
  • HttpServerRunnerTest - Testing handler.handleRoute() when I don't know what handler is going to be returned from router
  • FileHandlerTest - Not testing file extension types, but the build up to test these things is pretty extensive, making me think this should be in another class?
  • MethodOptionsHandlerTest - Class is not correct so test is not correct. Not a problem, I just don't know how to define the class so I am not sure what test cases to include.
  • Multi-Threading - The Cob spec test on this fails every dozen or so attempts, I am not really even sure how to address this, or test it at all because I don't know how to replicate the issue.
  • ~~FileHandler - How to stub files for dir

Java HTTP Server Refactors

Refactor branch

  • Removes Response interface
  • Adds MockHttpRouter guts to test SetUp
  • Modifies RequestParserTest to remove unnecessary test cases and adds params tests
  • Uncomments testReadRequest() from HttpServerIOTest
  • Includes FileSystem as dependency for FileIO and adds update and delete tests for HttpFileIOTest
  • Adds ResponseBuilder interface and MockHttpResponseBuilder to test FileHandler
@NicoleCarpenter
NicoleCarpenter / ttt-feedback.md
Last active June 2, 2016 15:59
TTT Feedback from Taka, Kofi and Lisa

File structure

  • should be more detailed (T | K)
  • mock files should exist on test side rather than lib side (T)

Naming

  • all validators (input, ttt_move, selection) are input validators, consider renaming input validator (T)
  • __is_winner() and __is_tie() methods do not return Booleans (T)

Logic

  • should work with lower max depth (T)
@NicoleCarpenter
NicoleCarpenter / ttt-user-stories.txt
Last active January 24, 2023 15:22
Tic-Tac-Toe user stories
#### Playing a Single Player Game Against a Random Computer (No Configuration)
* Given I start the game
* And I am prompted with a move
* When I select a move
* Then it will place my marker (X) on the board
* Given I have made a move
* When my turn is over
* Then the computer will have a random move placed on the board with its marker (O)