Class: FeatureGuard

Inherits:
SpecGuard show all
Defined in:
lib/mspec/guards/feature.rb

Instance Attribute Summary

Attributes inherited from SpecGuard

#name, #parameters

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SpecGuard

#===, #add, clear, clear_guards, finish, guards, #implementation?, #initialize, #os?, #platform?, #record, report, #report_key, #reporting?, ruby_version, ruby_version_override, ruby_version_override=, #standard?, #unregister, #windows?, #wordsize?, #yield?

Constructor Details

This class inherits a constructor from SpecGuard

Class Method Details

.enabled?(*features) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/mspec/guards/feature.rb', line 4

def self.enabled?(*features)
  new(*features).match?
end

Instance Method Details

#match?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/mspec/guards/feature.rb', line 8

def match?
  @parameters.all? { |f| MSpec.feature_enabled? f }
end