Class: OSpecFilter

Inherits:
Object show all
Defined in:
opal/lib/mspec/opal/runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOSpecFilter

Returns a new instance of OSpecFilter



6
7
8
# File 'opal/lib/mspec/opal/runner.rb', line 6

def initialize
  @filters = Set.new
end

Class Method Details

.mainObject



2
3
4
# File 'opal/lib/mspec/opal/runner.rb', line 2

def self.main
  @main ||= self.new
end

Instance Method Details

#===(description) ⇒ Object



14
15
16
# File 'opal/lib/mspec/opal/runner.rb', line 14

def ===(description)
  @filters.include? description
end

#fails(description) ⇒ Object



22
23
24
# File 'opal/lib/mspec/opal/runner.rb', line 22

def fails(description)
  @filters << description
end

#registerObject



10
11
12
# File 'opal/lib/mspec/opal/runner.rb', line 10

def register
  MSpec.register :exclude, self
end

#register_filters(description, block) ⇒ Object



18
19
20
# File 'opal/lib/mspec/opal/runner.rb', line 18

def register_filters(description, block)
  instance_eval(&block)
end