Richard Apodaca rapodaca

View gist:6517428
1 2 3 4 5 6 7 8 9 10
var CSV = require('csv');
 
CSV()
.from.string('foo\nbar\nbaz')
.on('record', function(row, index) {
if (index === 2) {
this.error(new Error('stop'));
}
})
.on('error', function(err) {
View gist:6517368
1 2 3 4 5 6 7 8 9 10
var CSV = require('csv');
 
CSV()
.from.string('foo\nbar\nbaz')
.on('record', function(row, index) {
if (index === 0) {
this.error(new Error('stop'));
}
})
.on('error', function(err) {
View gist:1943633
1 2 3 4 5 6 7 8 9 10
 
package com.kemga.framework;
 
import static org.junit.Assert.assertEquals;
 
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
View terasology-testing.markdown

Q: Why Test?

A: Most developers spend the majority of their time not writing code but debugging and maintaining it. Unit tests are one of the best ways to minimize unnecessary time spent on both. Testing also helps document your code. Finally, we use a passing unit test suite as one of the criteria for accepting pull requests.

Q: What software is used to test?

A: Terasology uses JUnit 4 for its automated test suite. It also uses Mockito for mocking/stubbing in special situations for which a dependency is too expensive or unreliable to bring into a test suite - for example, network activity or OpenGL.

An IDE is highly encouraged for running tests, as most support JUnit. On Eclipse, for example, you can quickly run a single test by right-clicking on the test method declaration and selecting "Run As -> JUnit Test". You can give this command a shortcut key of your choice to make it even faster.

View build.gradle
1 2 3 4 5 6 7 8 9 10
// See:
// http://gradle.1045684.n5.nabble.com/Groovy-Java-mixed-codebase-td1435484.html
// http://stackoverflow.com/questions/2572811/gradle-make-a-3rd-party-jar-available-to-local-gradle-repository
 
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'groovy'
 
sourceCompatibility = 1.6
version = '0.5.0'
View gist:1264773
1 2 3 4 5 6 7 8 9 10
#import <PhoneGap/JSON.h>
 
@implementation Test
-(void)foo:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
NSDictionary *map = [NSDictionary dictionary];
NSString *json = [map JSONRepresentation];
NSLog(@"%@", json);
}
@end
View gist:1260721
1 2 3 4
<div class="wrapper" style="overflow: auto;">
<div class="child" style="float: left;" ></div>
<div class="child" style="float: left;" ></div>
</div>
View gist:1245529
1 2 3
chemtab.browser.FileView.prototype.wiggle = function() {
goog.dom.classes.add(this.getElement(), 'wiggle');
};
View gist:1241613
1 2 3 4 5 6 7 8 9 10
/**
* See: http://jsfromhell.com/math/dot-line-length
*
* Distance from a point to a line or segment.
*
* @param {number} x point's x coord
* @param {number} y point's y coord
* @param {number} x0 x coord of the line's A point
* @param {number} y0 y coord of the line's A point
* @param {number} x1 x coord of the line's B point
View gist:144912
1 2 3 4 5 6 7 8 9 10
241
-OEChem-07100913442D
 
67 72 0 0 1 0 999 V2000
5.3950 -3.1602 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
4.9853 -3.8822 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
5.4045 -4.6006 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
6.2342 -4.5947 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
6.6482 -3.8727 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
6.2284 -3.1565 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
Something went wrong with that request. Please try again.