Module: ExAequo::RSpex::Macros::SubjectMacros

Defined in:
lib/ex_aequo/rspex/macros/subject_macros.rb

Instance Method Summary collapse

Instance Method Details

#it_eq(value, &blk) ⇒ Object Also known as: it_equals



8
9
10
11
12
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 8

def it_eq(value, &blk)
  specify do
    it_eq(value, &blk)
  end
end

#it_fails_spec(message = nil, with: RSpec::Expectations::ExpectationNotMetError, &blk) ⇒ Object



15
16
17
18
19
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 15

def it_fails_spec(message=nil, with: RSpec::Expectations::ExpectationNotMetError, &blk)
  specify do
    it_raises(with, message, &blk)
  end
end

#it_has_ivar(name, value, &blk) ⇒ Object



21
22
23
24
25
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 21

def it_has_ivar(name, value, &blk)
  specify do
    it_has_ivar(name, value, &blk)
  end
end

#it_has_same_lines(expected, &blk) ⇒ Object



60
61
62
63
64
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 60

def it_has_same_lines(expected, &blk)
  specify do
    it_has_same_lines(expected, &blk)
  end
end

#it_is(predicate, *args, &blk) ⇒ Object



27
28
29
30
31
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 27

def it_is(predicate, *args, &blk) 
  specify do
    it_is(predicate, *args, &blk)
  end
end

#it_is_between(lower, higher, &blk) ⇒ Object



33
34
35
36
37
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 33

def it_is_between(lower, higher, &blk)
  specify do
    it_is_between(lower, higher, &blk)
  end
end

#it_is_false(&blk) ⇒ Object



39
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 39

def it_is_false(&blk) = it_eq(false, &blk)

#it_is_falsy(&blk) ⇒ Object



40
41
42
43
44
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 40

def it_is_falsy(&blk)
  specify do
    it_is_falsy(&blk)
  end
end

#it_is_nil(&blk) ⇒ Object



46
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 46

def it_is_nil(&blk) = it_eq(nil, &blk)

#it_is_not(predicate, *args, &blk) ⇒ Object



47
48
49
50
51
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 47

def it_is_not(predicate, *args, &blk)
  specify do
    it_is_not(predicate, *args, &blk)
  end
end

#it_is_true(&blk) ⇒ Object



53
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 53

def it_is_true(&blk) = it_eq(true, &blk)

#it_is_truthy(&blk) ⇒ Object



54
55
56
57
58
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 54

def it_is_truthy(&blk)
  specify do
    it_is_truthy(&blk)
  end
end

#it_matches(matcher, &blk) ⇒ Object



66
67
68
69
70
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 66

def it_matches(matcher, &blk)
  specify do
    it_matches(matcher, &blk)
  end
end

#it_matches_output(*parts, to: :stdout, &blk) ⇒ Object



72
73
74
75
76
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 72

def it_matches_output(*parts, to: :stdout, &blk)
  specify do
    it_matches_output(*parts, to:, &blk)
  end
end

#it_puts(lines, to: $stdout, &blk) ⇒ Object



84
85
86
87
88
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 84

def it_puts(lines, to: $stdout, &blk)
  specify do
    it_puts(lines, to:, &blk)
  end
end

#it_raises(exception, message = nil, &blk) ⇒ Object



78
79
80
81
82
# File 'lib/ex_aequo/rspex/macros/subject_macros.rb', line 78

def it_raises(exception, message=nil,&blk)
  specify do
    it_raises(exception, message, &blk)
  end
end