Skip to content

Instantly share code, notes, and snippets.

require 'sequel'
require 'logger'
DB = Sequel.connect "postgres:///scrap"
DB.loggers << Logger.new(STDOUT)
Sequel::Model.plugin :tactical_eager_loading
DB.drop_table? :posts
1)
File.read raises a Errno::EISDIR when passed a path that is a directory FAILED
Expected Errno::EISDIR but got Errno::EINVAL (Invalid argument - read(2) failed)
{ } in main.__script__ at spec/ruby/core/file/shared/read.rb:6
Kernel(Object)#instance_eval at kernel/common/eval.rb:158
{ } in Enumerable(Array)#all? at kernel/common/enumerable.rb:205
Array#each at kernel/bootstrap/array.rb:163
Enumerable(Array)#all? at kernel/common/enumerable.rb:205
Array#each at kernel/bootstrap/array.rb:163
main.__script__ at spec/ruby/core/file/read_spec.rb:4
1)
File.read raises a Errno::EISDIR when passed a path that is a directory FAILED
Expected Errno::EISDIR but got Errno::EINVAL (Invalid argument - read(2) failed)
{ } in main.__script__ at spec/ruby/core/file/shared/read.rb:6
Kernel(Object)#instance_eval at kernel/common/eval.rb:158
{ } in Enumerable(Array)#all? at kernel/common/enumerable.rb:205
Array#each at kernel/bootstrap/array.rb:163
Enumerable(Array)#all? at kernel/common/enumerable.rb:205
Array#each at kernel/bootstrap/array.rb:163
main.__script__ at spec/ruby/core/file/read_spec.rb:4
chris@delacroix:~$ irb
ree-1.8.7-2010.02 > File.read(".")
Errno::EINVAL: Invalid argument - .
from (irb):1:in `read'
from (irb):1
ree-1.8.7-2010.02 >
require 'rubygems'
require 'benchmark'
require 'haml'
engine = Haml::Engine.new(File.read("template.haml"))
Benchmark.bm do |x|
x.report { 1000.times{ engine.render } }
end
Fabrication::DuplicateFabricatorError in 'Fabrication::Support.find_definitions before(:all)'
'awesome_object' is already defined
/home/chris/fabrication/lib/fabrication/fabricator.rb:6:in `define'
/home/chris/fabrication/lib/fabrication.rb:26:in `Fabricator'
/home/chris/fabrication/spec/fabricators.rb:1:in `<top (required)>'
/home/chris/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:235:in `load'
/home/chris/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:235:in `block in load'
/home/chris/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/home/chris/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
/home/chris/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
require 'mongoid'
Mongoid.configure { |config| config.master = Mongo::Connection.new.db 'mongoid_test' }
class User
include Mongoid::Document
field :email
field :name
class Quiz
include Mongoid::Document
embeds_many :topics
# fields...
end
class Topic
include Mongoid::Document
embedded_in :quiz
Loading development environment (Rails 3.0.3)
ruby-1.9.2-p0 > Quiz.collection.remove
=> true
ruby-1.9.2-p0 > Fabricate :built_quiz
=> #<Quiz _id: 4d2e3c770de0690d95000001, created_at: 2011-01-12 23:42:47 UTC, updated_at: 2011-01-12 23:42:47 UTC, user_id: BSON::ObjectId('4d2e3c770de0690d95000002'), time: 0, number: 1, built_at: 2011-01-12 23:42:47 UTC, completed_at: nil, graded_at: nil>
ruby-1.9.2-p0 > Quiz.count
=> 1
ruby-1.9.2-p0 > Quiz.collection.find_one
=> {"_id"=>BSON::ObjectId('4d2e3c770de0690d95000001'), "time"=>0, "user_id"=>BSON::ObjectId('4d2e3c770de0690d95000002'), "built_at"=>2011-01-12 23:42:47 UTC, "created_at"=>2011-01-12 23:42:47 UTC, "number"=>1, "updated_at"=>2011-01-12 23:42:47 UTC, "topics"=>[{"_id"=>1, "given"=>14}, {"_id"=>2, "given"=>10}, {"_id"=>3, "given"=>15}, {"_id"=>4, "given"=>13}], "pages"=>[{"time"=>0, "_id"=>1, "questions"=>[{"strikes"=>[], "_id"=>1, "problem_id"=>8577}, {"strikes"=>[], "_id"=>2, "problem_id"=>6262}, {"strikes"=>[], "_id"=>3, "problem_id"=>1369}, {"strik
Spec failures on mongoid f2ddfdd (2.0.0.rc.7)
Pending:
Mongoid::Relations::Builders::Referenced::ManyToMany#build Github 246: Should return documents in same order as ids
# Not Yet Implemented
# ./spec/functional/mongoid/relations/builders/referenced/many_to_many_spec.rb:32
Mongoid::Persistence::Update#persist when the document is changed when the document is a tree
# Not Yet Implemented
# ./spec/unit/mongoid/persistence/update_spec.rb:155