Skip to content

Commit 47a3d47

Browse files
committedNov 13, 2013
Cleanup some spec filters
1 parent 8bcb3ed commit 47a3d47

File tree

5 files changed

+130
-70
lines changed

5 files changed

+130
-70
lines changed
 

‎spec/filters/bugs/array.rb

-6
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,6 @@
202202
fails "Array#hash returns the same hash for equal recursive arrays"
203203
fails "Array#hash returns the same fixnum for arrays with the same content"
204204

205-
fails "Array#initialize_copy tries to convert the passed argument to an Array using #to_ary"
206-
fails "Array#initialize_copy does not make self dependent to the original array"
207-
fails "Array#initialize_copy returns self"
208-
fails "Array#initialize_copy properly handles recursive arrays"
209-
fails "Array#initialize_copy replaces the elements with elements from other array"
210-
211205
fails "Array#partition properly handles recursive arrays"
212206
fails "Array#partition returns in the left array values for which the block evaluates to true"
213207
fails "Array#partition returns two arrays"

‎spec/filters/bugs/string.rb

+22-19
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
opal_filter "String" do
2+
fails "String#capitalize is locale insensitive (only upcases a-z and only downcases A-Z)"
3+
4+
fails "String#center with length, padding raises an ArgumentError if padstr is empty"
5+
fails "String#center with length, padding raises a TypeError when padstr can't be converted to a string"
6+
fails "String#center with length, padding calls #to_str to convert padstr to a String"
7+
fails "String#center with length, padding raises a TypeError when length can't be converted to an integer"
8+
fails "String#center with length, padding calls #to_int to convert length to an integer"
29
fails "String#center with length, padding pads with whitespace if no padstr is given"
310
fails "String#center with length, padding returns a new string of specified length with self centered and padded with padstr"
411

5-
fails "String#lines should split on the default record separator and return enumerator if not block is given"
12+
fails "String#downcase is locale insensitive (only replaces A-Z)"
613

7-
fails "String#upcase is locale insensitive (only replaces a-z)"
8-
fails "String#size returns the length of self"
9-
fails "String#length returns the length of self"
14+
fails "String#end_with? converts its argument using :to_str"
15+
fails "String#end_with? returns true if other is empty"
1016

17+
fails "String#index raises a TypeError if passed a Symbol"
1118
# we need regexp rewriting for these
1219
fails "String#index with Regexp supports \\G which matches at the given start offset"
1320
fails "String#index with Regexp starts the search at the given offset"
1421
fails "String#index with Regexp returns the index of the first match of regexp"
1522

16-
fails "String#index raises a TypeError if passed a Symbol"
17-
23+
fails "String#intern does not special case certain operators"
1824
fails "String#intern special cases +(binary) and -(binary)"
19-
fails "String#to_sym special cases +(binary) and -(binary)"
25+
26+
fails "String#length returns the length of self"
27+
28+
fails "String#lines should split on the default record separator and return enumerator if not block is given"
29+
30+
fails "String#size returns the length of self"
2031

2132
fails "String#start_with? ignores arguments not convertible to string"
2233
fails "String#start_with? converts its argument using :to_str"
23-
fails "String#end_with? converts its argument using :to_str"
24-
fails "String#end_with? returns true if other is empty"
25-
fails "String#downcase is locale insensitive (only replaces A-Z)"
26-
fails "String#intern does not special case certain operators"
34+
2735
fails "String#to_sym does not special case certain operators"
28-
fails "String#capitalize is locale insensitive (only upcases a-z and only downcases A-Z)"
29-
fails "String#center with length, padding raises an ArgumentError if padstr is empty"
30-
fails "String#center with length, padding raises a TypeError when padstr can't be converted to a string"
31-
fails "String#center with length, padding calls #to_str to convert padstr to a String"
32-
fails "String#center with length, padding raises a TypeError when length can't be converted to an integer"
33-
fails "String#center with length, padding calls #to_int to convert length to an integer"
34-
fails "String#chomp when passed an Object raises a TypeError if #to_str does not return a String"
35-
fails "String#chomp when passed no argument returns a copy of the String when it is not modified"
36+
fails "String#to_sym special cases +(binary) and -(binary)"
37+
38+
fails "String#upcase is locale insensitive (only replaces a-z)"
3639
end

‎spec/filters/unsupported/immutable_strings.rb

+15
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,19 @@
66
fails "Time#strftime formats time according to the directives in the given format string"
77
fails "Time#strftime with %z formats a local time with positive UTC offset as '+HHMM'"
88
fails "Time#strftime with %z formats a local time with negative UTC offset as '-HHMM'"
9+
10+
fails "String#chomp when passed no argument returns a copy of the String when it is not modified"
11+
12+
fails "String#chop returns a new string when applied to an empty string"
13+
14+
fails "String#chop! removes the final character"
15+
fails "String#chop! removes the final carriage return"
16+
fails "String#chop! removes the final newline"
17+
fails "String#chop! removes the final carriage return, newline"
18+
fails "String#chop! removes the carrige return, newline if they are the only characters"
19+
fails "String#chop! does not remove more than the final carriage return, newline"
20+
fails "String#chop! returns self if modifications were made"
21+
fails "String#chop! returns nil when called on an empty string"
22+
fails "String#chop! raises a RuntimeError on a frozen instance that is modified"
23+
fails "String#chop! raises a RuntimeError on a frozen instance that would not be modified"
924
end

‎spec/filters/unsupported/tainted.rb

+58-30
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,91 @@
11
opal_filter 'tainted' do
2-
fails "Array#clear keeps tainted status"
3-
fails "Array#compact! keeps tainted status even if all elements are removed"
4-
fails "Array#delete_at keeps tainted status"
5-
fails "Array#delete_if keeps tainted status"
6-
fails "Array#delete keeps tainted status"
7-
fails "Array#shift passed a number n as an argument keeps taint status"
8-
fails "Array#shift passed a number n as an argument returns an untainted array even if the array is tainted"
9-
fails "Array#pop passed a number n as an argument keeps taint status"
10-
fails "Array#pop passed a number n as an argument returns an untainted array even if the array is tainted"
11-
fails "Array#pop keeps taint status"
12-
fails "Array#+ does not get infected even if an original array is tainted"
2+
fails "Kernel#to_s returns a tainted result if self is tainted"
3+
4+
fails "Array#* with a string with a tainted separator taints the result if the array has two or more elements"
5+
fails "Array#* with a string with a tainted separator does not taint the result if the array has only one element"
6+
fails "Array#* with a string with a tainted separator does not taint the result if the array is empty"
137
fails "Array#* with an integer copies the taint status of the original array if the passed count is not 0"
148
fails "Array#* with an integer copies the taint status of the original array even if the array is empty"
159
fails "Array#* with an integer copies the taint status of the original array even if the passed count is 0"
16-
fails "Array#compact does not keep tainted status even if all elements are removed"
17-
fails "Array#map! keeps tainted status"
18-
fails "Array#map does not copy tainted status"
10+
11+
fails "Array#+ does not get infected even if an original array is tainted"
12+
13+
fails "Array#clear keeps tainted status"
14+
1915
fails "Array#clone copies taint status from the original"
20-
fails "Array#collect! keeps tainted status"
16+
2117
fails "Array#collect does not copy tainted status"
18+
19+
fails "Array#collect! keeps tainted status"
20+
21+
fails "Array#compact does not keep tainted status even if all elements are removed"
22+
23+
fails "Array#compact! keeps tainted status even if all elements are removed"
24+
2225
fails "Array#concat keeps tainted status"
2326
fails "Array#concat keeps the tainted status of elements"
27+
28+
fails "Array#delete keeps tainted status"
29+
30+
fails "Array#delete_at keeps tainted status"
31+
32+
fails "Array#delete_if keeps tainted status"
33+
2434
fails "Array#dup copies taint status from the original"
35+
2536
fails "Array#inspect taints the result if an element is tainted"
2637
fails "Array#inspect does not taint the result if the Array is tainted but empty"
2738
fails "Array#inspect taints the result if the Array is non-empty and tainted"
28-
fails "Array#to_s taints the result if an element is tainted"
29-
fails "Array#to_s does not taint the result if the Array is tainted but empty"
30-
fails "Array#to_s taints the result if the Array is non-empty and tainted"
39+
3140
fails "Array#join with a tainted separator taints the result if the array has two or more elements"
3241
fails "Array#join with a tainted separator does not taint the result if the array has only one element"
3342
fails "Array#join with a tainted separator does not taint the result if the array is empty"
3443
fails "Array#join taints the result if the result of coercing an element is tainted"
3544
fails "Array#join does not taint the result if the Array is tainted but empty"
3645
fails "Array#join taints the result if the Array is tainted and non-empty"
37-
fails "Array#* with a string with a tainted separator taints the result if the array has two or more elements"
38-
fails "Array#* with a string with a tainted separator does not taint the result if the array has only one element"
39-
fails "Array#* with a string with a tainted separator does not taint the result if the array is empty"
4046

41-
fails "Hash#reject taints the resulting hash"
47+
fails "Array#pop passed a number n as an argument keeps taint status"
48+
fails "Array#pop passed a number n as an argument returns an untainted array even if the array is tainted"
49+
fails "Array#pop keeps taint status"
4250

43-
fails "Kernel#to_s returns a tainted result if self is tainted"
51+
fails "Array#map! keeps tainted status"
52+
fails "Array#map does not copy tainted status"
4453

45-
fails "String#upcase taints result when self is tainted"
46-
fails "String#to_s taints the result when self is tainted"
47-
fails "String#to_str taints the result when self is tainted"
48-
fails "String#swapcase taints resulting string when self is tainted"
49-
fails "String#reverse taints the result if self is tainted"
54+
fails "Array#shift passed a number n as an argument keeps taint status"
55+
fails "Array#shift passed a number n as an argument returns an untainted array even if the array is tainted"
56+
57+
fails "Array#to_s taints the result if an element is tainted"
58+
fails "Array#to_s does not taint the result if the Array is tainted but empty"
59+
fails "Array#to_s taints the result if the Array is non-empty and tainted"
60+
61+
fails "Hash#reject taints the resulting hash"
5062

51-
fails "Pathname.new is tainted if path is tainted"
52-
fails "String#downcase taints result when self is tainted"
5363
fails "String#capitalize taints resulting string when self is tainted"
64+
65+
fails "String#downcase taints result when self is tainted"
66+
5467
fails "String#center with length, padding when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self"
5568
fails "String#center with length, padding taints result when self or padstr is tainted"
69+
5670
fails "String#chomp when passed a String does not taint the result when the argument is tainted"
5771
fails "String#chomp when passed a String taints the result if self is tainted"
5872
fails "String#chomp when passed '\\n' taints the result if self is tainted"
5973
fails "String#chomp when passed '' taints the result if self is tainted"
6074
fails "String#chomp when passed nil taints the result if self is tainted"
6175
fails "String#chomp when passed nil returns a copy of the String"
6276
fails "String#chomp when passed no argument taints the result if self is tainted"
77+
78+
fails "String#chop taints result when self is tainted"
79+
80+
fails "String#reverse taints the result if self is tainted"
81+
82+
fails "String#swapcase taints resulting string when self is tainted"
83+
84+
fails "String#to_s taints the result when self is tainted"
85+
86+
fails "String#to_str taints the result when self is tainted"
87+
88+
fails "String#upcase taints result when self is tainted"
89+
90+
fails "Pathname.new is tainted if path is tainted"
6391
end

‎spec/filters/unsupported/trusted.rb

+35-15
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,61 @@
11
opal_filter "Object#trusted/untrusted" do
2-
fails "Array#pop passed a number n as an argument keeps untrusted status"
3-
fails "Array#pop passed a number n as an argument returns a trusted array even if the array is untrusted"
4-
fails "Array#pop keeps untrusted status"
2+
fails "Kernel#to_s returns an untrusted result if self is untrusted"
3+
54
fails "Array#+ does not infected even if an original array is untrusted"
5+
66
fails "Array#* with an integer copies the untrusted status of the original array if the passed count is not 0"
77
fails "Array#* with an integer copies the untrusted status of the original array even if the array is empty"
88
fails "Array#* with an integer copies the untrusted status of the original array even if the passed count is 0"
9+
fails "Array#* with a string with an untrusted separator untrusts the result if the array has two or more elements"
10+
fails "Array#* with a string with an untrusted separator does not untrust the result if the array has only one element"
11+
fails "Array#* with a string with an untrusted separator does not untrust the result if the array is empty"
12+
913
fails "Array#delete keeps untrusted status"
14+
1015
fails "Array#delete_if keeps untrusted status"
16+
1117
fails "Array#delete_at keeps untrusted status"
12-
fails "Array#compact! keeps untrusted status even if all elements are removed"
13-
fails "Array#compact does not keep untrusted status even if all elements are removed"
18+
1419
fails "Array#clear keeps untrusted status"
15-
fails "Array#map does not copy untrusted status"
20+
1621
fails "Array#clone copies untrusted status from the original"
17-
fails "Array#collect! keeps untrusted status"
22+
1823
fails "Array#collect does not copy untrusted status"
24+
25+
fails "Array#compact does not keep untrusted status even if all elements are removed"
26+
27+
fails "Array#compact! keeps untrusted status even if all elements are removed"
28+
29+
fails "Array#collect! keeps untrusted status"
30+
1931
fails "Array#concat keeps untrusted status"
2032
fails "Array#concat is not infected untrustedness by the other"
2133
fails "Array#concat keeps the untrusted status of elements"
34+
2235
fails "Array#dup copies untrusted status from the original"
23-
fails "Array#map! keeps untrusted status"
36+
2437
fails "Array#inspect untrusts the result if an element is untrusted"
2538
fails "Array#inspect does not untrust the result if the Array is untrusted but empty"
2639
fails "Array#inspect untrusts the result if the Array is untrusted"
27-
fails "Array#to_s untrusts the result if an element is untrusted"
28-
fails "Array#to_s does not untrust the result if the Array is untrusted but empty"
29-
fails "Array#to_s untrusts the result if the Array is untrusted"
40+
3041
fails "Array#join with an untrusted separator untrusts the result if the array has two or more elements"
3142
fails "Array#join with an untrusted separator does not untrust the result if the array has only one element"
3243
fails "Array#join with an untrusted separator does not untrust the result if the array is empty"
3344
fails "Array#join untrusts the result if the result of coercing an element is untrusted"
3445
fails "Array#join does not untrust the result if the Array is untrusted but empty"
3546
fails "Array#join untrusts the result if the Array is untrusted and non-empty"
36-
fails "Array#* with a string with an untrusted separator untrusts the result if the array has two or more elements"
37-
fails "Array#* with a string with an untrusted separator does not untrust the result if the array has only one element"
38-
fails "Array#* with a string with an untrusted separator does not untrust the result if the array is empty"
3947

40-
fails "Kernel#to_s returns an untrusted result if self is untrusted"
48+
fails "Array#map does not copy untrusted status"
49+
50+
fails "Array#pop passed a number n as an argument keeps untrusted status"
51+
fails "Array#pop passed a number n as an argument returns a trusted array even if the array is untrusted"
52+
fails "Array#pop keeps untrusted status"
53+
54+
fails "Array#map! keeps untrusted status"
55+
56+
fails "Array#to_s untrusts the result if an element is untrusted"
57+
fails "Array#to_s does not untrust the result if the Array is untrusted but empty"
58+
fails "Array#to_s untrusts the result if the Array is untrusted"
59+
60+
fails "String#chop untrusts result when self is untrusted"
4161
end

0 commit comments

Comments
 (0)
Please sign in to comment.