Skip to content

Instantly share code, notes, and snippets.

View hhariri's full-sized avatar

Hadi Hariri hhariri

View GitHub Profile
function logger(options) {
if ('object' == typeof options) {
options = options || {};
} else if (options) {
options = { format: options };
} else {
options = {};
}
void InitRequest(string uri, object query, HttpMethod method)
{
Request.Uri = !String.IsNullOrEmpty(_baseUri) ? _uriComposer.Compose(_baseUri, uri, query): uri;
Request.Data = null;
Request.PutFilename = String.Empty;
Request.Expect = false;
Request.KeepAlive = true;
Request.MultiPartFormData = null;
Request.MultiPartFileData = null;
Request.ContentEncoding = null;
public class When_baseuri_is_null_and_query_is_null
{
Establish context = () =>
{
uriComposer = new UriComposer();
query = null;
baseUri = null;
};
Because of = () => url = uriComposer.Compose(baseUri, query, uri);
require(["mathFunctions"], function (math) {
console.log(math.add(5,3));
console.log(math.subtract(10, 3));
});
/**
* Make a request to a specific URL using a method
* @param {string} url
* @param {string} method
*/
var makeRequestDocumented = function (url, method) {
// make a request
};
package samples
import kspec.framework.*
spec public fun calculatorSpecs() {
given("a calculator", {
val calculator = Calculator()
spec public fun calculatorSpecs() {
var calculator: Calculator
var sum = 0
given("a calculator", { calculator = Calculator() })
@hhariri
hhariri / SpekSample.kt
Created January 21, 2013 14:47
Spek Example
given("a calculator", {
val calculator = Calculator()
on("calling sum with two numbers", {
val sum = calculator.sum(2, 3)
it("should return the sum of the two numbers", {
public fun given(description : String, givenExpression: () -> Unit) {
// code omitted
}
public fun on(description: String, onExpression: () -> Unit) {
// code omitted
}
given("I have nothing", {
it("should do nothing", {
on("not doing anything", {
})
})
})