This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logger(options) { | |
if ('object' == typeof options) { | |
options = options || {}; | |
} else if (options) { | |
options = { format: options }; | |
} else { | |
options = {}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["mathFunctions"], function (math) { | |
console.log(math.add(5,3)); | |
console.log(math.subtract(10, 3)); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make a request to a specific URL using a method | |
* @param {string} url | |
* @param {string} method | |
*/ | |
var makeRequestDocumented = function (url, method) { | |
// make a request | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package samples | |
import kspec.framework.* | |
spec public fun calculatorSpecs() { | |
given("a calculator", { | |
val calculator = Calculator() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spec public fun calculatorSpecs() { | |
var calculator: Calculator | |
var sum = 0 | |
given("a calculator", { calculator = Calculator() }) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public fun given(description : String, givenExpression: () -> Unit) { | |
// code omitted | |
} | |
public fun on(description: String, onExpression: () -> Unit) { | |
// code omitted | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
given("I have nothing", { | |
it("should do nothing", { | |
on("not doing anything", { | |
}) | |
}) | |
}) | |