This is an addition to a full guide on SailsJS + Mocha, but updated for SailsJS 0.10.x
The guide does not belong to me, only this change to support SailsJS 0.10.x using code originally found in the guide written by it's author.
This is an addition to a full guide on SailsJS + Mocha, but updated for SailsJS 0.10.x
The guide does not belong to me, only this change to support SailsJS 0.10.x using code originally found in the guide written by it's author.
# * Style guide based on Rails documention | |
module Namespace #:nodoc: don't document this | |
# Generic Namespace exception class | |
class NamespaceError < StandardError | |
end | |
# Raised when... | |
class SpecificError < NamespaceError | |
end |
# Support for http digest auth | |
# Discovered here: http://johan.bingodisk.com/public/code/net_digest_auth.rb | |
require 'digest/md5' | |
require 'net/http' | |
module Net | |
module HTTPHeader | |
@@nonce_count = -1 | |
CNONCE = Digest::MD5.new("%x" % (Time.now.to_i + rand(65535))).hexdigest |
@javascript | |
Scenario: confiming when saving inactive | |
Given I expect to click "OK" on a confirmation box saying "Are you sure?" | |
When I press "Save" | |
Then the confirmation box should have been displayed | |
And I should see "TV" in the "Campaign Keywords" section | |
Scenario: alert when form is not valid | |
Given I expect to click on an alert box saying "Please complete all fields in this form" | |
When I press "Save" |
<?php | |
// This example is for testing php with libcurl | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://www.howsmyssl.com/a/check"); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
/** | |
* Configure advanced options for the Express server inside of Sails. | |
* | |
* For more information on configuration, check out: | |
* http://sailsjs.org/#documentation | |
*/ | |
module.exports.express = { | |
middleware: { | |
poweredBy: false | |
}, |
# Object Interface in Ruby. | |
# Suggestion of implementation for object-oriented interfaces. | |
# | |
# ===== Example | |
# | |
# bike = AcmeBicycle.new | |
# bike.change_gear(1) | |
# # => AbstractInterface::InterfaceNotImplementedError: AcmeBicycle needs to implement 'change_gear' for interface Bicycle! | |
# | |
# See:: http://www.metabates.com/2011/02/07/building-interfaces-and-abstract-classes-in-ruby |
Atom editor settings for Belanton Team. | |
You can use these settings on your Atom editor [http://atom.io] copy. Here are | |
defaults Atom config files (config.cson, init.coffee, keymap.cson, snippets.cson and | |
styles.less) and Project Manager package list [http://atom.io/packages/project-manager]. |
You can use these settings on your RubyMine [http://rubymine.org]. Here are some RubyMine Live Templates. |
$ grep -lR "__TVOS_PROHIBITED" . | while read L; do echo "## $L"; echo "\`\`\`obj-c"; grep "__TVOS_PROHIBITED" "$L"; echo "\`\`\`"; echo; done
AVAudioSessionPortOverrideSpeaker __TVOS_PROHIBITED = 'spkr'
AVAudioSessionCategoryOptionAllowBluetooth __TVOS_PROHIBITED = 0x4,
AVAudioSessionCategoryOptionDefaultToSpeaker __TVOS_PROHIBITED = 0x8,