Code Monkey @ Sauce Labs
Gross
use Inhouse::Library;
use JSON;
$user = Inhouse::Library::createUser({
username => "zoidberg",
password => "doctor"
});
print JSON::to_json($user);
gavin.pl
const Users = require('./models/users.js');
Users.createUser({
username => "zoidberg",
password => "doctor"
}).then(function(user) {
console.log($user);
});
gavin.js
(Gavin draws the best)
Don't forget bugs
Really easy.
test "should save article with title" do
article = Article.new(title => "Gavin's Article")
assert article.save
end
test "should load with the same title" do
# create new article
created_article = Article.create(title => "Gavin's Better Article")
assert_not_null created_article
# load from DB
loaded_article = Article.find(created_article.id)
# check values
assert_not_null loaded_article
assert_equal loaded_article.title, "Gavin's Better Article"
end
Gavin Mogan