Skip to content

Instantly share code, notes, and snippets.

View Ragmaanir's full-sized avatar
🐢
Compiling ...

Ragmaanir Ragmaanir

🐢
Compiling ...
View GitHub Profile
module X
C = 1
end
describe 'Test' do
include X
it '...' do
p C
end
end
expect{
User.authenticate(user.email,invalid_password)
}.to change{
# *user* is not changed!
# i have to a)
User.first(:email => user.email).last_failed_login_attempt_at
# or b)
#user.reload
# user.last_....
require "dm_spec"
require 'dm-core'
require 'dm-migrations'
require 'dm-types'
require 'dm-validations'
require 'dm-timestamps'
before :create do
@temp_tx = DataMapper::Transaction.new(Friendship)
@temp_tx.begin
end
after :create do
(@temp_tx.rollback and throw :halt) if some_conditions
@temp_tx.commit
end
require "dm_spec"
require 'dm-core'
require 'dm-migrations'
require 'dm-types'
require 'dm-validations'
require 'dm-timestamps'
require "dm_spec"
require 'dm-core'
require 'dm-migrations'
require 'dm-types'
require 'dm-validations'
require 'dm-timestamps'
source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'sqlite3'
DM_VERSION = '~> 1.2.0'
gem 'dm-rails', DM_VERSION
gem 'dm-sqlite-adapter', DM_VERSION
@Ragmaanir
Ragmaanir / gist:1162677
Created August 22, 2011 15:31
cyclic definitions
object A1 { val X = B1.Y }
object B1 { val Y :Int = A1.X }
println(A1.X)
object A2 { val X = B2.Y+1 }
object B2 { val Y :Int = A2.X*2 }
println(A2.X)
@Ragmaanir
Ragmaanir / gist:1904749
Created February 25, 2012 00:04
rspec core issue: shared context and its
describe 'shared context and its' do
shared_context :shared => :ctx do
before{ puts 'before';raise if @x; @x = true }
end
describe 'failing', :shared => :ctx do
its(:length){}
it(:ok){}
end
end
rm -r output
mkdir -p output/objects
mkdir -p output/image/boot/grub
ldc2 -de -enable-asserts -enable-color -enable-preconditions -disable-red-zone -enable-contracts -nogc -w -m64 -boundscheck=off -relocation-model=pic -c source/kernel.d -c source/types.d -c source/string.d -c source/vga_terminal.d -odoutput/objects
nasm -f elf64 source/boot_header.asm -o output/objects/boot_header.o &&
nasm -f elf64 source/boot.asm -o output/objects/boot.o &&
ld -nostdlib -nodefaultlibs -n -o output/image/boot/kernel.bin -T source/linker.ld output/objects/boot_header.o output/objects/boot.o output/objects/kernel.o output/objects/string.o output/objects/vga_terminal.o output/objects/types.o &&
cp source/grub.cfg output/image/boot/grub/ &&
grub-mkrescue -o output/image.iso output/image