Class: Thoreau::Model::TestFamily

Inherits:
Object
  • Object
show all
Defined in:
lib/thoreau/model/test_family.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asserts:, desc:, expected_exception:, expected_output:, failure_expected:, input_specs:, kind:, setups:) ⇒ TestFamily

Returns a new instance of TestFamily.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/thoreau/model/test_family.rb', line 14

def initialize(asserts:,
               desc:,
               expected_exception:,
               expected_output:,
               failure_expected:,
               input_specs:,
               kind:,
               setups:
)
  @asserts            = asserts
  @desc               = desc
  @expected_exception = expected_exception
  @expected_output    = expected_output
  @failure_expected   = failure_expected
  @input_specs        = input_specs
  @kind               = kind
  @setups             = setups
end

Instance Attribute Details

#assertsObject (readonly)

Returns the value of attribute asserts.



5
6
7
# File 'lib/thoreau/model/test_family.rb', line 5

def asserts
  @asserts
end

#descObject

Returns the value of attribute desc.



12
13
14
# File 'lib/thoreau/model/test_family.rb', line 12

def desc
  @desc
end

#expected_exceptionObject (readonly)

Returns the value of attribute expected_exception.



5
6
7
# File 'lib/thoreau/model/test_family.rb', line 5

def expected_exception
  @expected_exception
end

#expected_outputObject (readonly)

Returns the value of attribute expected_output.



5
6
7
# File 'lib/thoreau/model/test_family.rb', line 5

def expected_output
  @expected_output
end

#focus=(value) ⇒ Object (writeonly)

Sets the attribute focus

Parameters:

  • value

    the value to set the attribute focus to.



10
11
12
# File 'lib/thoreau/model/test_family.rb', line 10

def focus=(value)
  @focus = value
end

#kindObject (readonly)

Returns the value of attribute kind.



5
6
7
# File 'lib/thoreau/model/test_family.rb', line 5

def kind
  @kind
end

#setupsObject (readonly)

Returns the value of attribute setups.



5
6
7
# File 'lib/thoreau/model/test_family.rb', line 5

def setups
  @setups
end

#use_legacy_snapshotObject

Returns the value of attribute use_legacy_snapshot.



11
12
13
# File 'lib/thoreau/model/test_family.rb', line 11

def use_legacy_snapshot
  @use_legacy_snapshot
end

Instance Method Details

#failure_expected?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/thoreau/model/test_family.rb', line 38

def failure_expected?
  @failure_expected
end

#focused?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/thoreau/model/test_family.rb', line 42

def focused?
  @focus
end

#input_specsObject



33
34
35
36
# File 'lib/thoreau/model/test_family.rb', line 33

def input_specs
  @input_specs.size == 0 ?
    [{}] : @input_specs
end

#to_sObject



46
47
48
# File 'lib/thoreau/model/test_family.rb', line 46

def to_s
  "#{@desc || "#{@kind} #{(@input_specs.map &:to_s).to_sentence } expect #{expected_output}"}"
end