Skip to content

Instantly share code, notes, and snippets.

View lbergelson's full-sized avatar
💭
🐳

Louis Bergelson lbergelson

💭
🐳
View GitHub Profile
@lbergelson
lbergelson / FactoryTest.java
Created July 1, 2015 18:59
example of using TestNG @DataProviders together with a @factory constructor
import org.testng.Assert;
import org.testng.ITest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
/**
* Example of using TestNG DataProviders and a Factory constructor to generate multiple sets of tests which can each
* make use of their own data providers.
@lbergelson
lbergelson / pre-commit
Created August 7, 2014 16:03
Add this to your .git/hooks/pre-commit to have it run travis lint whenever your .travis.yml runs
!/bin/bash
#Add me to your .git/hooks/pre-commit in order to run travis lint when your .travis.yml changes
#This own't work if travis CLI isn't installed
#Note that I require bash, not sh
if grep --quiet ".travis.yml" <( git diff --cached --name-only )
then
travis lint -x
if [ $? -ne 0 ]; then { echo "failing travis lint"; exit 1; } fi