Skip to content

Instantly share code, notes, and snippets.

Created December 19, 2012 17:33
Show Gist options
  • Save anonymous/4338588 to your computer and use it in GitHub Desktop.
Save anonymous/4338588 to your computer and use it in GitHub Desktop.
An uncoveret mutation in virtus that might be able to act as demonstration object 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)
Alive: rspec:Virtus::Attribute.build:/home/mbj/devel/virtus/lib/virtus/attribute.rb:62:417c7 (0.15s)
@@ -1,6 +1,6 @@
def self.build(name, type = Object,options = {})
(attribute_class = determine_type(type) || raise(ArgumentError, "#{type.inspect} does not map to an attribute type"))
attribute_options = attribute_class.merge_options(type, options)
- attribute_class.new(name, attribute_options)
+ attribute_class.new(name)
end
Kille
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment