Skip to content

Commit

Permalink
Group all private_method filters together
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 29, 2013
1 parent 71d5e42 commit f55b77e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
1 change: 0 additions & 1 deletion spec/filters/bugs/array.rb
Expand Up @@ -90,7 +90,6 @@
fails "Array#initialize with (array) calls #to_ary to convert the value to an array"
fails "Array#initialize raises a RuntimeError on frozen arrays"
fails "Array#initialize preserves the object's identity even when changing its value"
fails "Array#initialize is private"

fails "Array#insert tries to convert the passed position argument to an Integer using #to_int"

Expand Down
5 changes: 0 additions & 5 deletions spec/filters/bugs/delegate.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/filters/bugs/language.rb
Expand Up @@ -122,10 +122,7 @@
fails "A singleton method definition can be declared for a global variable"
fails "A singleton method definition can be declared for an instance variable"
fails "A singleton method definition can be declared for a local variable"
fails "Defining an 'initialize' method sets the method's visibility to private"
fails "Defining an 'initialize_copy' method sets the method's visibility to private"

fails "The defined? keyword when called with a method name having a module as a receiver returns nil if the method is private"
fails "The defined? keyword for a scoped constant returns nil when an undefined constant is scoped to a defined constant"
fails "The defined? keyword for a top-level scoped constant returns nil when an undefined constant is scoped to a defined constant"

Expand Down Expand Up @@ -240,11 +237,8 @@
fails "The return keyword when passed a splat returns an array when used as a splat"
fails "The return keyword in a Thread raises a LocalJumpError if used to exit a thread"

fails "Invoking a private getter method does not permit self as a receiver"
fails "Invoking a method with manditory and optional arguments raises an ArgumentError if too many values are passed"
fails "Invoking a method with optional arguments raises ArgumentError if extra arguments are passed"
# fails "Invoking a method passes a literal hash without curly braces or parens"
# fails "Invoking a method passes literal hashes without curly braces as the last parameter"
fails "Invoking a method raises a SyntaxError with both a literal block and an object as block"
fails "Invoking a method with an object as a block uses 'to_proc' for coercion"

Expand Down Expand Up @@ -338,8 +332,6 @@
fails "The yield call taking multiple arguments with a splat does not pass an argument value if the splatted argument is nil"

fails "The defined? keyword when called with a method name without a receiver returns nil if the method is not defined"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the method is private"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the method is protected"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the method is not defined"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the class is not defined"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the subclass is not defined"
Expand Down
1 change: 0 additions & 1 deletion spec/filters/bugs/set.rb
@@ -1,5 +1,4 @@
opal_filter "Set" do
fails "Set#initialize is private"
fails "Set#== returns true when the passed Object is a Set and self and the Object contain the same elements"
fails "Set#== does not depend on the order of nested Sets"
fails "Set#merge raises an ArgumentError when passed a non-Enumerable"
Expand Down
2 changes: 0 additions & 2 deletions spec/filters/bugs/singleton.rb
@@ -1,8 +1,6 @@
opal_filter "Singleton" do
fails "Singleton.allocate is a private method"
fails "Singleton#_dump returns an empty string"
fails "Singleton#_dump returns an empty string from a singleton subclass"
fails "Singleton.instance returns an instance of the singleton's clone"
fails "Singleton.instance returns the same instance for multiple class to instance on clones"
fails "Singleton.new is a private method"
end
20 changes: 20 additions & 0 deletions spec/filters/unsupported/private_methods.rb
@@ -0,0 +1,20 @@
opal_filter "Private methods" do
fails "Array#initialize is private"
fails "The defined? keyword when called with a method name having a module as a receiver returns nil if the method is private"

fails "Defining an 'initialize' method sets the method's visibility to private"
fails "Defining an 'initialize_copy' method sets the method's visibility to private"

fails "Invoking a private getter method does not permit self as a receiver"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the method is private"
fails "The defined? keyword when called with a method name having a module as receiver returns nil if the method is protected"

fails "SimpleDelegator.new doesn't forward private method calls"
fails "SimpleDelegator.new doesn't forward private method calls even via send or __send__"
fails "SimpleDelegator.new forwards protected method calls"

fails "Set#initialize is private"

fails "Singleton.allocate is a private method"
fails "Singleton.new is a private method"
end

0 comments on commit f55b77e

Please sign in to comment.