Skip to content

Instantly share code, notes, and snippets.

View mbj's full-sized avatar

Markus Schirp mbj

View GitHub Profile
property :id, Serial
property :name, String, required: true
property :size, Integer
property :type, String
property :content, Binary, lazy: true, length: 1..209715200
property :uri, URI
property :created_at, DateTime
property :updated_at, DateTime
belongs_to :folder, model: Filemanager::Folder
describe User, '.with_first_name' do
let(:object) { described_class }
subject { object.with_first_name(name) }
let(:result) { mock('Result') }
let(:name) { mock('Name') }
before do
User.stub(:all => result)
@mbj
mbj / mutant.diff
Created December 14, 2012 11:12 — forked from anonymous/mutant.diff
Mutant configuration:
Matcher: #<Mutant::Matcher::ObjectSpace scope_name_pattern=/\AVeritas(\z|::)/>
Filter: Mutant::Mutation::Filter::ALL
Strategy: #<Mutant::Strategy::Rspec::DM2>
Subject: Veritas::Attribute::Decimal.primitive:/home/mbj/devel/veritas/lib/veritas/attribute/decimal.rb:17
Alive: rspec:noop:Veritas::Attribute::Decimal.primitive:/home/mbj/devel/veritas/lib/veritas/attribute/decimal.rb:17:0f3cd (0.18s)
Subject: Veritas::Aliasable#define_inheritable_alias_method:/home/mbj/devel/veritas/lib/veritas/support/aliasable.rb:35
def define_inheritable_alias_method(new_method, original_method)
class_eval(" def #{new_method}(*args, &block) # def |(*args, &block)\n self.#{original_method}(*args, &block) # self.union(*args, &block)\n end # end\n", __FILE__, 36 + 1)
end
@mbj
mbj / mutation.diff
Created December 19, 2012 17:33 — forked from anonymous/mutation.diff
Uncovered mutation in virtus that can be a subject for a blog post about mutation testing.
Subject: Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62
Alive: rspec:noop:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:3fa65 (0.23s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:6b800 (0.14s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:dcc9b (0.14s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:4834d (0.12s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:3f41d (0.12s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:3764e (0.12s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:f66a9 (0.14s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:6c517 (0.14s)
Killed: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:b41f5 (0.14s)