Skip to content

Instantly share code, notes, and snippets.

💭
Working on a top secret new TDD Feature

Dave Schinkel dschinkel

💭
Working on a top secret new TDD Feature
Block or report user

Report or block dschinkel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dschinkel
dschinkel / MakeCallTest.java
Last active Aug 16, 2019
Roboelectric - Example of Finding a Child Fragment from a test
View MakeCallTest.java
/*
Dave Schinkel's Notes after he wrote this test:
This is a test I wrote headlessly with Roboelectric around an existing Legacy codebase that's a mess.
We want to get some sort of confidence with an integration test which is what this test gave us for a
certain part of this codebase.
This test indirectly tests behavior further down by
checking what I ultimately expected to be rendered
View gulpfile.js
const gulp = require('gulp'),
less = require('gulp-less'),
babel = require("gulp-babel"),
shell = require('gulp-shell'),
mocha = require('gulp-mocha'),
rename = require('gulp-rename'),
bro = require('gulp-bro'),
del = require('del'),
{ series, dest, src } = require('gulp');
@dschinkel
dschinkel / Calculator.kt
Last active May 28, 2019
Roman Numeral Calculator kata - Kotlin
View Calculator.kt
package roman.numeral.calculator.kotlin
class Calculator {
private val toRoman = mapOf(
"IIIII" to "V",
"VV" to "X",
"XXXXX" to "L",
"LL" to "C",
"CCCCC" to "D",
View Calculator.kt
package roman.numeral.calculator.kotlin
class Calculator {
private val toRoman = mapOf(
"IIIII" to "V",
"VV" to "X",
"XXXXX" to "L",
"LL" to "C",
"CCCCC" to "D",
"DD" to "M"
@dschinkel
dschinkel / SomeSpecUsingSuperagent.js
Last active May 14, 2019
Some example Mocha, Supertest, and Superagent tests I've written
View SomeSpecUsingSuperagent.js
/*
Note:
Uses superagent and mocha assertions.
This is how I do these tests nowdays, without supertest, just plain superagent.
*/
import request from 'superagent'
it('returns a list of participants', async () => {
const url = 'https://someurl';
@dschinkel
dschinkel / Collections.kt
Last active May 26, 2019
Kotlin Recipes / Example Snippets
View Collections.kt
/*
MUTABLE MAPS
------------
Note: Its type is inferred by underlying values within
*/
val toRoman = mutableMapOf(
"IIIII" to "V",
"VV" to "X"
)
View FakeNumberServer.java
import com.fasterxml.jackson.jr.ob.JSON;
import java.util.Map;
import static spark.Spark.get;
import static spark.Spark.port;
public class FakeNumberServer {
public static void main(String[] args) {
port(2000);
@dschinkel
dschinkel / RomanNumeralCalculator.java
Last active May 16, 2019
Roman Numeral Calculator Kata
View RomanNumeralCalculator.java
import com.sun.xml.internal.xsom.impl.scd.Iterators;
import java.util.ArrayList;
import java.util.HashMap;
public class RomanNumeralCalculator {
ArrayList<String> numeralOrder = new ArrayList<String>() {{
add("I");
add("V");
@dschinkel
dschinkel / SkunkWork.kt
Created Mar 11, 2019
Android Remove Item Spike
View SkunkWork.kt
package com.kata.skunkworks
data class SkunkWork(val title: String)
View EmailSweeper.java
package subscriptions;
import dependencies.User;
import dependencies.UserMailer;
import dependencies.UserRepository;
public class EmailSweeper {
UserMailer mailer;
UserRepository repository;
String unpaidMessage = "Please renew your subscription to Ferret Fancy!";
You can’t perform that action at this time.