Class: BugGuard

Inherits:
VersionGuard show all
Defined in:
lib/extensions/mspec/mspec/guards/bug.rb

Constant Summary

Constants inherited from VersionGuard

VersionGuard::FULL_RUBY_VERSION

Instance Attribute Summary

Attributes inherited from SpecGuard

#name

Instance Method Summary collapse

Methods inherited from SpecGuard

#add, clear, clear_guards, finish, guards, #record, report, #report_key, #reporting?, ruby_version, #run_if, #run_unless, #unregister, #yield?

Constructor Details

#initialize(bug, version) ⇒ BugGuard

Returns a new instance of BugGuard.



4
5
6
7
8
9
10
11
12
13
# File 'lib/extensions/mspec/mspec/guards/bug.rb', line 4

def initialize(bug, version)
  @bug = bug
  if String === version
    MSpec.deprecate "ruby_bug with a single version", 'an exclusive range ("2.1"..."2.3")'
    @version = SpecVersion.new version, true
  else
    super(version)
  end
  @parameters = [@bug, @version]
end

Instance Method Details

#match?Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
22
23
# File 'lib/extensions/mspec/mspec/guards/bug.rb', line 15

def match?
  return false if MSpec.mode? :no_ruby_bug
  return false unless PlatformGuard.standard?
  if Range === @version
    super
  else
    FULL_RUBY_VERSION <= @version
  end
end