Skip to content

Instantly share code, notes, and snippets.

View acnalesso's full-sized avatar

Antonio C Nalesso Moreira acnalesso

View GitHub Profile

its isn't core to RSpec. One the of the focuses of RSpec is on the documentation aspects of tests. Unfortunately, its often leads to documentation output that is essentially lies. Consider this spec:

User = Struct.new(:name, :email)

describe User do
  subject { User.new("bob") }
  its(:name) { should == "bob" }
end
@acnalesso
acnalesso / .vimrc
Last active December 23, 2015 13:48
VimL ( Vim Language ) key maps.
" map :w to r to save and run tets
map r :w<CR>
" map wq to :wq
map wq :wq<CR>
" map Caps (bye bye) to quit from insert mode
imap <Caps> <Esc><CR>
" map watchr to run tests, looks for
@acnalesso
acnalesso / specs.watchr
Created September 20, 2013 21:10
watchr script to automate tests
#-*- ruby -*-
#
# MAKE SURE YOU CHANGE THE YOUR TESTS DIR
# AND YOUR LIB DIR
#
# Run me with:
# $ watchr specs.watchr
@acnalesso
acnalesso / output
Created July 16, 2013 09:16
impressionist_#96
FIRST_TIME
test_app$ rails g impressionist --orm active_record -f
invoke active_record
remove db/migrate/20130716090507_create_impressions_table.rb
create db/migrate/20130716091134_create_impressions_table.rb
create config/initializers/impression.rb
SECOND_TIME, impression.rb already exists
test_app$ rails g impressionist --orm active_record -f
@acnalesso
acnalesso / asset.rb
Last active May 14, 2016 15:16
Create Paperclip thumbnails out of video files using avconv as ffmpeg is deprecated.
# app/model/
# Your model where you've defined has_attached_file
# Do not define :original in your styles
class Asset < ActiveRecord::Base
attr_accessible :position, :picture_cover, :asset
belongs_to(:assetable, :polymorphic => true)
has_attached_file :asset,
:styles => {
@acnalesso
acnalesso / admin_controller_spec.rb
Created May 28, 2013 00:59
Good or Bad? Poor or Fine?
require 'spec_helper'
describe AdminController do
# Stubs out, returns true. Logged in as Admin
login(true)
describe 'GET' do
let(:admin) { mock_model(Admin) }
@acnalesso
acnalesso / rb2.0_output
Created May 27, 2013 21:33
mpapis: find /home/nbit001/.rvm/rubies/ruby-1.9.3-p429
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby/dl.h
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby/version.h
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby/digest.h
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby/intern.h
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby/re.h
/home/nbit001/.rvm/rubies/ruby-2.0.0-p195/include/ruby-2.0.0/ruby/regex.h
$ rvm install 1.9.3 --with-gcc=gcc --debug | tee ~/Desktop/ruby1_9_output
1.9.3 - install
__rvm_setup_compile_environment_setup ruby-1.9.3-p429
rvm_autolibs_flag=disabled
__rvm_setup_compile_environment_requirements ruby-1.9.3-p429
__rvm_setup_compile_environment_osx_compiler ruby-1.9.3-p429
__rvm_setup_compile_environment_architectures ruby-1.9.3-p429
__rvm_setup_compile_environment_gcc47plus ruby-1.9.3-p429
__rvm_setup_compile_environment_bison ruby-1.9.3-p429
$ rvm install 1.9.3 --debug
1.9.3 - install
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/debian/6.0/x86_64/ruby-1.9.3-p429.tar.bz2
rvm_autolibs_flag=disabled
ruby-1.9.3-p429 - #configure
ruby-1.9.3-p429 - #download
Archive checksum matched, not downloading
Downloaded archive checksum matched.
@acnalesso
acnalesso / gist:5651567
Created May 26, 2013 03:02
No such file or directory
Searching for binary rubies, this might take some time.
Installing requirements for debian, might require sudo password.
ruby-2.0.0-p195 - #configure
ruby-2.0.0-p195 - #download
ruby-2.0.0-p195 - #validate archive
ruby-2.0.0-p195 - #extract
ruby-2.0.0-p195 - #validate binary
ruby-2.0.0-p195 - #setup
Saving wrappers to '/home/nbit001/.rvm/wrappers/ruby-2.0.0-p195'...........
ruby-2.0.0-p195 - #importing default gemsets, this may take time......................