Module: Wist::Helpers

Defined in:
lib/wist.rb

Class Method Summary collapse

Class Method Details

.blank?(obj) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/wist.rb', line 41

def blank?(obj)
  obj.respond_to?(:empty?) ? obj.empty? : !obj
end

.detect_assert_syntaxObject



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/wist.rb', line 27

def detect_assert_syntax
  return if Wist.assert_syntax_detected

  if defined?(RSpec)
    if RSpec.configuration.expect_with[0].configuration.syntax.include?(:expect)
      Wist.rspec_expect = true
    else
      Wist.rspec_should = true
    end
  end

  Wist.assert_syntax_detected = true
end