Skip to content

Instantly share code, notes, and snippets.

~/Projects/c++test # clang++ -std=c++11 test.cpp
test.cpp:52:18: error: variable type 'AbstractPerson' is an abstract class
AbstractPerson x = Teacher("Thomas");
^
test.cpp:19:20: note: unimplemented pure virtual method '_getName' in 'AbstractPerson'
virtual string _getName() = 0;
^
test.cpp:20:18: note: unimplemented pure virtual method '_isTeacher' in 'AbstractPerson'
virtual bool _isTeacher() = 0;
^
module WithContextsHelpers
class WithContextsBuilder
attr_accessor :contexts, :examples, :group
def initialize(group)
@contexts = {}
@group = group
end
def context(name, &blk)
describe FooClass do
contexts do
context "on tuesday" do
let(:day) { "Tuesday" }
end
context "on saturday" do
let(:day) { "Saturday" }
end
~/Projects/better_matchers (*) # rvm gemset list
gemsets for ruby-2.1.0 (found in /home/thomasfedb/.rvm/gems/ruby-2.1.0)
=> (default)
better_matchers
biblios
global
has_many_through
rspec-expect_it
class Admin::UsersController < Admin::ApplicationController
def index
@users = policy_scope(User)
end
def new
@user = User.new
authorize @user
end
class StaticsController < ApplicationController
def about_us
# render view
end
end
describe "#new" do
subject { get :new, study_id: study.id }
specify { expect_it.to be_successful }
specify { expect_it.to assign(:instrument).with_a_new(Instrument) }
describe_assign(:instrument) do
specify { expect_its(:study_id).to eq study.id }
end
end
describe StudiesController do
sign_in
describe "#index" do
let(:studies) { FactoryGirl.create_list :study, 3 }
subject { get :index }
specify { expect_it.to be_successful }
specify { expect_it.to assign(:studies).with(studies) }
Biblios::Application.routes.draw do
resource :dashboard, only: [:show]
resource :session, only: [:new, :create, :destroy]
resources :studies
end