Module: Sass::Script::Functions::SasspectationsMatchers

Included in:
Sass::Script::Functions
Defined in:
lib/sasspectations_matchers.rb

Instance Method Summary collapse

Instance Method Details

#to_be_even(base) ⇒ Object



81
82
83
84
85
86
87
# File 'lib/sasspectations_matchers.rb', line 81

def to_be_even(base)
  if base.value % 2 == 0
    pass
  else
    base
  end
end

#to_be_odd(base) ⇒ Object



73
74
75
76
77
78
79
# File 'lib/sasspectations_matchers.rb', line 73

def to_be_odd(base)
  if base.value % 2 != 0
    pass
  else
    base
  end
end

#to_contain(search, string) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/sasspectations_matchers.rb', line 44

def to_contain(search, string)
  if string.value.include? search.value
    pass
  else
    search
  end
end

#to_divisible_by(base, divisible_by) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/sasspectations_matchers.rb', line 60

def to_divisible_by(base, divisible_by )
  if base.value % divisible_by.value == 0
    pass
  else
    base
  end
end

#to_equal(actual, expected) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/sasspectations_matchers.rb', line 4

def to_equal(actual, expected)
  if expected.value == actual.value
    pass
  else
    actual
  end
end

#to_factor_ofObject



68
69
70
# File 'lib/sasspectations_matchers.rb', line 68

def to_factor_of()
  # TODO: 
end

#to_greater_than(big, small) ⇒ Object

end



28
29
30
31
32
33
34
# File 'lib/sasspectations_matchers.rb', line 28

def to_greater_than(big, small)
  if big.value > small.value
    pass
  else
    big
  end
end

#to_in_range(number, start_range, end_range) ⇒ Object



89
90
91
92
93
94
95
# File 'lib/sasspectations_matchers.rb', line 89

def to_in_range(number, start_range, end_range)
  if (number.value <= end_range.value) && (number.value >= start_range.value)
    pass
  else
    number
  end
end

#to_less_than(small, big) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/sasspectations_matchers.rb', line 36

def to_less_than(small, big)
  if small.value < big.value
    pass
  else
    small
  end
end

#to_not_contain(search, string) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/sasspectations_matchers.rb', line 52

def to_not_contain(search, string)
  if !string.value.include? search.value
    pass
  else
    search
  end
end

#to_not_equal(actual, expected) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/sasspectations_matchers.rb', line 12

def to_not_equal(actual, expected)
  if expected.value != actual.value
    pass
  else
    actual
  end
end