Skip to content

Commit

Permalink
Use Array#inspect specs from rubyspec
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Sep 22, 2013
1 parent 050f0b3 commit d4c992e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions spec/filters/bugs/array.rb
Expand Up @@ -126,6 +126,8 @@
fails "Array#index returns the index of the first element == to object"
fails "Array#index given no argument and no block produces an Enumerator"

fails "Array#inspect calls inspect on its elements and joins the results with commas"

fails "Array#join calls #to_str to convert the separator to a String"
fails "Array#join does not call #to_str on the separator if the array is empty"
fails "Array#join raises a TypeError if the separator cannot be coerced to a String by calling #to_str"
Expand Down
6 changes: 6 additions & 0 deletions spec/filters/unsupported/encoding.rb
@@ -0,0 +1,6 @@
opal_filter "Encoding" do
fails "Array#inspect raises if inspected result is not default external encoding"
fails "Array#inspect use US-ASCII encoding if the default external encoding is not ascii compatible"
fails "Array#inspect use the default external encoding if it is ascii compatible"
fails "Array#inspect returns a US-ASCII string for an empty Array"
end
3 changes: 3 additions & 0 deletions spec/filters/unsupported/float.rb
@@ -0,0 +1,3 @@
opal_filter "Float" do
fails "Array#inspect represents a recursive element with '[...]'"
end
3 changes: 3 additions & 0 deletions spec/filters/unsupported/tainted.rb
Expand Up @@ -22,4 +22,7 @@
fails "Array#concat keeps tainted status"
fails "Array#concat keeps the tainted status of elements"
fails "Array#dup copies taint status from the original"
fails "Array#inspect taints the result if an element is tainted"
fails "Array#inspect does not taint the result if the Array is tainted but empty"
fails "Array#inspect taints the result if the Array is non-empty and tainted"
end
3 changes: 3 additions & 0 deletions spec/filters/unsupported/trusted.rb
Expand Up @@ -21,4 +21,7 @@
fails "Array#concat keeps the untrusted status of elements"
fails "Array#dup copies untrusted status from the original"
fails "Array#map! keeps untrusted status"
fails "Array#inspect untrusts the result if an element is untrusted"
fails "Array#inspect does not untrust the result if the Array is untrusted but empty"
fails "Array#inspect untrusts the result if the Array is untrusted"
end
7 changes: 0 additions & 7 deletions spec/rubyspec/core/array/inspect_spec.rb

This file was deleted.

1 change: 1 addition & 0 deletions spec/rubyspecs
Expand Up @@ -32,6 +32,7 @@ core/array/include_spec
core/array/index_spec
core/array/initialize_spec
core/array/insert_spec
core/array/inspect_spec
core/array/intersection_spec
core/array/keep_if_spec
core/array/last_spec
Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -4,6 +4,12 @@

ENV['MSPEC_RUNNER'] = true

class Encoding
class << self
attr_accessor :default_external
end
end

class OSpecFilter
def self.main
@main ||= self.new
Expand Down

0 comments on commit d4c992e

Please sign in to comment.