Skip to content

Instantly share code, notes, and snippets.

View vicatcu's full-sized avatar

Victor Aprea vicatcu

View GitHub Profile
var commandList = ["a", "b", "c"];
var commandFuncs = [];
for(var i = 0; i < commandList.length; i++){
var cmd = commandList[i];
commandFuncs.push( function(callback){
setTimeout(function(){
console.log(cmd);
callback(null);
}, 500);
*:80 is a NameVirtualHost
default server ithacagenerator.org (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost ithacagenerator.org (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost bugzilla.ithacagenerator.org (/etc/apache2/sites-enabled/bugzilla.ithacagenerator.org.conf:4)
alias bugzilla.ithacagenerator.is-very-nice.org
port 80 namevhost drupal.ithacagenerator.org (/etc/apache2/sites-enabled/drupal.ithacagenerator.org.conf:4)
alias drupal.ithacagenerator.is-very-nice.org
port 80 namevhost phpmyadmin.ithacagenerator.org (/etc/apache2/sites-enabled/phpmyadmin.ithacagenerator.org.conf:4)
alias phpmyadmin.ithacagenerator.is-very-nice.org
port 80 namevhost wiki.ithacagenerator.org (/etc/apache2/sites-enabled/wiki.ithacagenerator.org.conf:4)
#
# wiki.ithacagenerator.org (/etc/apache2/sites-available/wiki.ithacagenerator.org)
#
<VirtualHost *:80>
ServerAdmin webmaster@ithacagenerator.org
ServerName wiki.ithacagenerator.org
ServerAlias wiki.ithacagenerator.is-very-nice.org
# Indexes + Directory Root.
DirectoryIndex index.html
VirtualHost configuration:
*:80 is a NameVirtualHost
default server ithacagenerator.org (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost ithacagenerator.org (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost bugzilla.ithacagenerator.org (/etc/apache2/sites-enabled/bugzilla.ithacagenerator.org.conf:4)
alias bugzilla.ithacagenerator.is-very-nice.org
port 80 namevhost drupal.ithacagenerator.org (/etc/apache2/sites-enabled/drupal.ithacagenerator.org.conf:4)
alias drupal.ithacagenerator.is-very-nice.org
port 80 namevhost phpmyadmin.ithacagenerator.org (/etc/apache2/sites-enabled/phpmyadmin.ithacagenerator.org.conf:4)
alias phpmyadmin.ithacagenerator.is-very-nice.org
SPEC
describe "when a membeship is created" do
let!(:another_membership) { FactoryGirl.create(:membership, user: user, membership_type: membertype,
start: Date.parse("2013-11-15")) }
context "if there are other memberships associated with user" do
it "sets the end date for any of them that have a nil end date" do
expect(Membership.find_by(start: Date.parse("2012-11-15"))).not_to be_nil
require 'rails_helper'
RSpec.describe Membership, :type => :model do
let!(:user) { FactoryGirl.create(:user, gnucash_id: "FOO")}
let!(:membertype) { FactoryGirl.create(:membership_type, name: "BAR", monthlycost: 23)}
let!(:membership) { FactoryGirl.create(:membership, user: user, membership_type: membertype,
start: Date.parse("2012-11-15")) }
subject { membership }
Failures:
1) Membership when a membeship is created if there are other memberships associated with user sets the end date for any of them that have a nil end date
Failure/Error: expect(Membership.find_by(start: Date.parse("2012-11-15")).end).not_to be_nil
expected: not nil
got: nil
# ./spec/models/membership_spec.rb:35:in `block (4 levels) in <top (required)>'
def enforce_at_most_one_open_for_user
new_end_date = self.start.prev_day
if !self.user.nil?
self.user.memberships.each do |m|
if m.id != self.id && m.nil?
go.nil
m.end = new_end_date
m.save!
end
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\security.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\sntp.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\socket.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\wlan.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\WildFire_CC3000_Library\ccspi.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\WildFire_CC3000_Library\WildFire_CC3000.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\WildFire_CC3000_Library\WildFire_CC3000_Server.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build178728290971216