Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MSpec.time_from
- - returns a Time object if the parse is successful
- - uses UTC for the timezone
- - understands and parses yyyy/mm/dd format
- - understands and parses yyyy/mm/dd format with [.-_] alternate separator
- - understands and parses mm/dd/yyyy format
- - understands and parses mm/dd/yyyy format with [.-_] alternate separator
- - understands and parses yyyy/mm/dd hh:mm[:ss] format
- - understands and parses yyyy/mm/dd hh:mm[:ss] format with [.-_] separators
- - understands and parses mm/dd/yyyy hh:mm[:ss] format
- - understands and parses mm/dd/yyyy hh:mm[:ss] format with [.-_] separators
- MSpec.engine?
- - returns true if passed :ruby and RUBY_NAME == 'ruby'
- - returns true if passed :rbx and RUBY_NAME == 'rbx'
- - returns true if passed :rubinius and RUBY_NAME == 'rbx'
- - returns true if passed :jruby and RUBY_NAME == 'jruby'
- - returns false when passed an unrecognized name
- MSpec.guard?
- - accepts multiple arguments and passes them to the block
- - returns true when the block evaluates to true
- - returns false when the block evaluates to false
- MSpec.runner?
- - returns true when passed :mspec and ENV['MSPEC_RUNNER'] is true
- - returns false when passed :mspec and ENV['MSPEC_RUNNER'] is false
- - returns true when passed :rspec and ENV['RSPEC_RUNNER'] is false but the constant Spec exists
- - returns true when passed :rspec and ENV['RSPEC_RUNNER'] is true but the constant Spec does not exist
- MSpec.platform?
- - returns false when arg does not match RUBY_PLATFORM
- - returns false when no arg matches RUBY_PLATFORM
- - returns true when arg matches RUBY_PLATFORM
- - returns true when any arg matches RUBY_PLATFORM
- MSpec.version?
- - returns true if arg is numerically equivalent to version
- - returns false if arg is numerically smaller or larger than version
- - returns true if any of args is numerically equivalent to version
- - accepts preceding equality operator and returns version == given
- - accepts < preceding the version and returns version < given
- - accepts > preceding the version and returns version > given
- - accepts <= preceding the version and returns version <= given
- - accepts >= preceding the version and returns version >= given
- - accepts any combination of multiple comparisons and returns true if any is true
- - accepts Ranges and returns true if version numerically falls in range
- - returns false if version do not numerically fall in range
- MSpec.patch?
- - returns true if string is numerically equivalent to patchlevel
- - returns true if integer is numerically equivalent to patchlevel
- - returns false if string is numerically smaller/larger than patchlevel
- - returns false if integer is numerically not equal to patchlevel
- - returns true if any string is numerically equivalent to patchlevel
- - returns true if any integer is numerically equivalent to patchlevel
- - accepts mixed string and numeric arguments
- - accepts equality operator preceding the string returning patchlevel == given
- - accepts < preceding the string and returns patchlevel < given
- - accepts > preceding the string and returns patchlevel > given
- - accepts <= preceding the string and returns patchlevel <= given
- - accepts >= preceding the string and returns patchlevel >= given
- - accepts any combination of multiple comparisons and returns true if any match
- - accepts string Ranges and returns true if patch falls in the range
- - accepts integer Ranges and returns true for patch falls in the range
- MSpec.date? (converting argument with MSpec.time_from)
- - returns true when arg matches both dates
- - returns false when arg does not match dates
- - returns true when any arg matches dates
- - returns false when none of the args matches dates
- - accepts preceding equality operator and returns target date == date
- - accepts preceding < and returns target date < date
- - accepts preceding > and returns target date > date
- - accepts preceding <= and returns target date <= date
- - accepts preceding >= and returns target date >= date
- - returns true when arg is a Range and dates fall in the range
- - returns false when arg is a Range and dates do not fall in the range
- - raises an ArgumentError if given a Range with operators, not just dates
- MSpec.wordsize?
- - returns whether determined platform wordsize is 32 if given 32
- - returns whether determined platform wordsize is 64 if given 64
- MSpec.os?
- - returns true if host OS can be matched to given
- - returns false if host OS cannot be matched to given
- Object#quarantine!
- - never yields
- - may be used to nest other guards but they will never execute
- Object#ruby_bug
- - raises an exception if not given a report ID string
- - does not yield if host's RUBY_NAME == STANDARD
- - yields if host's RUBY_NAME != STANDARD
- - runs nested guards normally when it yields
- Object#fails_on
- - does not yield when RUBY_NAME matched
- - yields when RUBY_NAME not matched
- - runs nested guards normally when it yields
- Object#extended_on
- - does not yield when RUBY_NAME matched
- - yields when does RUBY_NAME not matched
- - runs nested guards normally when it yields
- Object#compliant_on
- - does not yield when RUBY_NAME not matched
- - yields when RUBY_NAME matched
- - implicitly includes STANDARD as an implementation
- - runs nested guards normally when it yields
- Object#not_compliant_on
- - does not yield when RUBY_NAME matched
- - yields when RUBY_NAME not matched
- - runs nested guards normally when it yields
- Object#deviates_on
- - does not yield when RUBY_NAME not matched
- - yields when RUBY_NAME matched
- - runs nested guards normally when it yields
- Object#platform_is
- - does not yield if RUBY_PLATFORM does not contain given
- - yields when RUBY_PLATFORM contains given
- - runs nested guards normally when it yields
- Object#platform_is_not
- - does not yield when matches RUBY_PLATFORM
- - yields when platform does not match RUBY_PLATFORM
- - runs nested guards normally when it yields
- Object#platform_is :version => VERSION_SPEC
- - yields when matches RUBY_VERSION
- - does not yield when does not match RUBY_VERSION
- - runs nested guards normally when it yields
- Object#platform_is_not :version => VERSION_SPEC
- - does not yield when matches RUBY_VERSION
- - yields when does not match RUBY_VERSION
- - runs nested guards normally when it yields
- Object#platform_is :patch => PATCHLEVEL_SPEC
- - does not yield when does not match RUBY_PATCHLEVEL
- - yields when matches RUBY_PATCHLEVEL
- - runs nested guards normally when it yields
- Object#platform_is_not :patch => PATCHLEVEL_SPEC
- - does not yield when matches RUBY_PATCHLEVEL
- - yields when does not match RUBY_PATCHLEVEL
- - runs nested guards normally when it yields
- Object#platform_is :date => DATE_SPEC
- - does not yield when does not match RUBY_RELEASE_DATE
- - yields when matches RUBY_RELEASE_DATE
- - runs nested guards normally when it yields
- Object#platform_is_not :date => DATE_SPEC
- - does not yield when matches RUBY_RELEASE_DATE
- - yields when matches RUBY_RELEASE_DATE
- - runs nested guards normally when it yields
- Object#platform_is :os => OS_SPEC
- - yields when host OS matches
- - does not yield when host OS does not match
- - runs nested guards normally when it yields
- Object#platform_is_not :os => OS_SPEC
- - does not yield when the host OS matches
- - yields when the host OS does not match
- - runs nested guards normally when it yields
- Object#platform_is :wordsize => SIZE_SPEC
- - yields when matches the platform's wordsize (32 or 64)
- - does not yield when the platform wordsize (32 or 64) is not matched
- - runs nested guards normally when it yields
- Object#platform_is_not :wordsize => SIZE_SPEC
- - yields when the platform wordsize (32 or 64) is not matched
- - does not yield when matches the platform's wordsize (32 or 64)
- - runs nested guards normally when it yields
- Object#runner_is
- - yields when passed :mspec and ENV['MSPEC_RUNNER'] is true
- - does not yield when passed :mspec and ENV['MSPEC_RUNNER'] is false
- - yields when passed :rspec and ENV['RSPEC_RUNNER'] is true
- - yields when passed :rspec and the constant Spec exists
- - does not yield when passed :rspec and ENV['RSPEC_RUNNER'] is false and the constant Spec does not exist
- - runs nested guards normally when it yields
- Object#runner_is_not
- - does not yield when passed :mspec and ENV['MSPEC_RUNNER'] is true
- - yields when passed :mspec and ENV['MSPEC_RUNNER'] is false
- - does not yield when passed :rspec and ENV['RSPEC_RUNNER'] is false but the constant Spec exists
- - does not yield when passed :rspec and ENV['RSPEC_RUNNER'] is true but the constant Spec does not exist
- - runs nested guards normally when it yields
- Finished in 0.132513 seconds
- 137 examples, 0 failures
- MSpec.version? with guard failure reporting
- - returns :match if engine version matches and engine version == STANDARD_VERSION
- - returns :mismatch if both match but engine version != STANDARD_VERSION
- - returns :standard_only if STANDARD_VERSION matches but engine version does not
- - returns :engine_only if engine version matches but STANDARD_VERSION does not
- - returns :neither if neither engine version nor STANDARD_VERSION match
- MSpec.patch? with guard failure reporting
- - returns :match if engine patchlevel matches and == STANDARD_PATCHLEVEL
- - returns :mismatch if both match but engine patchlevel != STANDARD_PATCHLEVEL
- - returns :standard_only if STANDARD_PATCHLEVEL matches but engine patchlevel does not
- - returns :engine_only if engine patchlevel matches but STANDARD_PATCHLEVEL not
- - returns :neither if neither engine patchlevel nor STANDARD_PATCHLEVEL match
- MSpec.date? with guard failure reporting
- - returns :match if engine date matches and == STANDARD_RELEASE_DATE
- - returns :mismatch if both match but engine date != STANDARD_RELEASE_DATE
- - returns :standard_only if STANDARD_RELEASE_DATE matches but engine date does not
- - returns :engine_only if engine date matches but STANDARD_RELEASE_DATE not
- - returns :neither if neither engine date nor STANDARD_RELEASE_DATE match
- #compliant_on with guard failures
- - if engine does not match, specs converted to ComplianceFailures
- - if engine matches, runs normally
- - always implicitly includes standard
- - runs nested guards normally if it yields
- #not_compliant_on with guard failures
- - if target is matched, specs converted to SpecTargetFailures
- - if engine engine matches but target does not, specs converted to ComplianceFailures
- - if neither engine nor target match, runs normally
- - runs nested guards normally if it yields
- #quarantine! with guard failures
- - always converts specs to GuardFailureErrors
- - never runs nested guards
- #ruby_bug with guard failures
- - raises an exception if not given a report ID string
- - if engine's RUBY_NAME == STANDARD, raises a GuardFailureError
- - if engine's RUBY_NAME != STANDARD, runs normally
- - runs nested guards normally when it yields
- #fails_on with guard failures
- - if target matches, converts specs to SpecTargetFailures
- - if engine engine matches but target does not, converts specs to ComplianceFailures
- - if neither engine nor target match, runs normally
- - runs nested guards normally when it yields
- #deviates_on with guard failures
- - if target matches, converts specs to SpecTargetFailures
- - if engine engine matches but target does not, converts specs to ComplianceFailures
- - if neither engine engine nor target matches, skips this block
- - never runs nested guards
- #extended_on with guard failures
- - if engine matches, runs normally
- - if engine not matched, skips this block
- - runs nested guards normally when it yields
- #platform_is with guard failures
- - if platform matches, runs normally
- - if platform not matched, skips this block
- - runs nested guards normally when it yields
- #platform_is :os with guard failures
- - if engine OS matches, runs normally
- - if engine OS not matched, skips this block
- - runs nested guards normally when it yields
- #platform_is :wordsize (32/64 bit) with guard failures
- - if engine wordsize matches, runs normally
- - if engine wordsize not matched, skips this block
- - runs nested guards normally when it yields
- #platform_is :version with guard failures
- - if neither target nor engine matches, converts specs to ComplianceFailures
- - if engine matches but target does not, converts specs to ComplianceFailures
- - if target matches but engine does not, converts specs to ComplianceFailures
- - if both match but engine != target, converts specs to PlatformMismatchFailures
- - if both match and engine == target, runs normally
- - runs nested guards normally when it yields
- #platform_is :patch with guard failures
- - if neither target nor engine matches, converts specs to ComplianceFailures
- - if engine matches but target does not, converts specs to ComplianceFailures
- - if target matches but engine does not, converts specs to ComplianceFailures
- - if both match but engine != target, converts specs to PlatformMismatchFailures
- - if both match and engine == target, runs normally
- - runs nested guards normally when it yields
- #platform_is :date with guard failures
- - if neither engine nor target matches, converts specs to ComplianceFailures
- - if engine matches and target does not, converts specs to ComplianceFailures
- - if target matches and engine does not, converts specs to ComplianceFailures
- - if both match but engine != target, converts specs to PlatformMismatchFailures
- - if both match and engine == target, runs normally
- - runs nested guards normally when it yields
- #platform_is_not with guard failures
- - if platform not matched, runs normally
- - if platform does match, skips this block
- - runs nested guards normally when it yields
- #platform_is_not :os with guard failures
- - if engine OS does not match, runs normally
- - if engine OS matched, skips this block
- - runs nested guards normally when it yields
- #platform_is_not :wordsize (32/64 bit) with guard failures
- - if engine wordsize does not match, runs normally
- - if engine wordsize matched, skips this block
- - runs nested guards normally when it yields
- #platform_is_not :version with guard failures
- - if engine matches and target does not, converts specs to ComplianceFailures
- - if target matches and engine does not, converts specs to ComplianceFailures
- - if both match but engine != target, converts specs to PlatformMismatchFailures
- - if both match and engine == target, converts specs to ComplianceFailures
- - if neither engine nor target matches, runs normally
- - runs nested guards normally when it yields
- #platform_is_not :patch with guard failures
- - if engine matches and target does not, converts specs to ComplianceFailures
- - if target matches and engine does not, converts specs to ComplianceFailures
- - if both match but engine != target, converts specs to PlatformMismatchFailures
- - if both match and engine == target, converts specs to ComplianceFailures
- - if neither engine nor target matches, runs normally
- - runs nested guards normally when it yields
- #platform_is_not :date with guard failures
- - if engine matches and target does not, converts specs to ComplianceFailures
- - if target matches and engine does not, converts specs to ComplianceFailures
- - if both match but engine != target, converts specs to PlatformMismatchFailures
- - if both match and engine == target, converts specs to ComplianceFailures
- - if neither engine nor target match, runs normally
- - runs nested guards normally when it yields
- Finished in 0.084309 seconds
- 94 examples, 0 failures
Add Comment
Please, Sign In to add comment