Skip to content

Commit 5a3771b

Browse files
committedOct 29, 2013
Store all filtered specs inside a Set (instead of hash)
1 parent f4dc25c commit 5a3771b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

Diff for: ‎spec/spec_helper.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'opal'
22
require 'file'
3+
require 'set'
34
require 'opal-parser'
45
require 'mspec'
56
require 'mspec/mock_install_method_patch'
@@ -22,23 +23,23 @@ def self.main
2223
end
2324

2425
def initialize
25-
@filters = {}
26+
@filters = Set.new
2627
end
2728

2829
def register
2930
MSpec.register :exclude, self
3031
end
3132

3233
def ===(description)
33-
@filters.has_key? description
34+
@filters.include? description
3435
end
3536

3637
def register_filters(description, block)
3738
instance_eval(&block)
3839
end
3940

4041
def fails(description)
41-
@filters[description] = true
42+
@filters << description
4243
end
4344
end
4445

0 commit comments

Comments
 (0)
Please sign in to comment.