Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Jul 26, 2013
1 parent 0103ea2 commit e802e15
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .rspec
@@ -1,4 +1,5 @@
--color
--format progress
--profile
--warnings
--order random
3 changes: 3 additions & 0 deletions lib/axiom/types/type.rb
Expand Up @@ -82,6 +82,9 @@ def self.include?(object)
constraint.call(object)
end

# Silence warnings when redeclaring constraint
singleton_class.class_eval { undef_method :constraint }

# Add a constraint to the type
#
# @example with an argument
Expand Down
Expand Up @@ -16,6 +16,7 @@
Module.any_instance.stub(:extended).with(object)

delegated_ancestor = false
Module.send(:undef_method, :extended)
Module.send(:define_method, :extended) { |_| delegated_ancestor = true }
expect { subject }.to change { delegated_ancestor }.from(false).to(true)
end
Expand Down
Expand Up @@ -16,6 +16,7 @@
Module.any_instance.stub(:extended).with(object)

delegated_ancestor = false
Module.send(:undef_method, :extended)
Module.send(:define_method, :extended) { |_| delegated_ancestor = true }
expect { subject }.to change { delegated_ancestor }.from(false).to(true)
end
Expand Down
Expand Up @@ -16,6 +16,7 @@
Module.any_instance.stub(:extended).with(object)

delegated_ancestor = false
Module.send(:undef_method, :extended)
Module.send(:define_method, :extended) { |_| delegated_ancestor = true }
expect { subject }.to change { delegated_ancestor }.from(false).to(true)
end
Expand Down

0 comments on commit e802e15

Please sign in to comment.