Class: Shoulda::Matchers::Text

Inherits:
String
  • Object
show all
Defined in:
lib/shoulda/matchers/util/word_wrap.rb

Constant Summary collapse

LIST_ITEM_REGEXP =
/\A((?:[a-z0-9]+(?:\)|\.)|\*) )/.freeze

Instance Method Summary collapse

Instance Method Details

#indented?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/shoulda/matchers/util/word_wrap.rb', line 46

def indented?
  self =~ /\A +/
end

#list_item?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/shoulda/matchers/util/word_wrap.rb', line 50

def list_item?
  self =~ LIST_ITEM_REGEXP
end

#match_as_list_itemObject



54
55
56
# File 'lib/shoulda/matchers/util/word_wrap.rb', line 54

def match_as_list_item
  match(LIST_ITEM_REGEXP)
end