Skip to content

Instantly share code, notes, and snippets.

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

Ragmaanir Ragmaanir

🐢
Compiling ...
View GitHub Profile
@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
@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)
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
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'
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'
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_....