Class: Fix::Run Private

Inherits:
Object
  • Object
show all
Defined in:
lib/fix/run.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Run class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment, requirement, *challenges) ⇒ Run

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Run.

Parameters:

  • environment (::Fix::Dsl)

    A context instance.

  • requirement (::Spectus::Requirement::Base)

    An expectation.

  • challenges (Array<::Defi::Challenge>)

    A list of challenges.



22
23
24
25
26
# File 'lib/fix/run.rb', line 22

def initialize(environment, requirement, *challenges)
  @environment = environment
  @requirement = requirement
  @challenges  = challenges
end

Instance Attribute Details

#challengesArray<::Defi::Challenge> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns A list of challenges.

Returns:

  • (Array<::Defi::Challenge>)

    A list of challenges.



17
18
19
# File 'lib/fix/run.rb', line 17

def challenges
  @challenges
end

#environment::Fix::Dsl (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns A context instance.

Returns:



11
12
13
# File 'lib/fix/run.rb', line 11

def environment
  @environment
end

#requirement::Spectus::Requirement::Base (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns An expectation.

Returns:

  • (::Spectus::Requirement::Base)

    An expectation.



14
15
16
# File 'lib/fix/run.rb', line 14

def requirement
  @requirement
end

Instance Method Details

#test(&subject) ⇒ ::Expresenter::Pass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Verify if the object checks the condition.

Parameters:

  • subject (Proc)

    The block of code to be tested.

Returns:

  • (::Expresenter::Pass)

    A passed spec instance.

Raises:

  • (::Expresenter::Fail)

    A failed spec exception.

See Also:



36
37
38
39
40
# File 'lib/fix/run.rb', line 36

def test(&subject)
  requirement.call { actual_value(&subject) }
rescue ::Expresenter::Fail => e
  e
end