Module: CfScript::Output::Tests
- Included in:
- CfScript::Output
- Defined in:
- lib/cf_script/output/tests.rb
Instance Method Summary collapse
- #already_exists?(type, name) ⇒ Boolean
- #authenticated? ⇒ Boolean
- #contains?(text) ⇒ Boolean
- #credentials_rejected? ⇒ Boolean
- #failed? ⇒ Boolean
- #is_already?(name, state) ⇒ Boolean
- #matches?(regexp) ⇒ Boolean
- #no_api_endpoint? ⇒ Boolean
- #not_authorized? ⇒ Boolean
- #not_found?(type, name) ⇒ Boolean
- #not_logged_in? ⇒ Boolean
- #ok? ⇒ Boolean
Instance Method Details
#already_exists?(type, name) ⇒ Boolean
47 48 49 |
# File 'lib/cf_script/output/tests.rb', line 47 def already_exists?(type, name) out.last_line_matches?(/#{type} #{name} already exists/) end |
#authenticated? ⇒ Boolean
15 16 17 |
# File 'lib/cf_script/output/tests.rb', line 15 def authenticated? matches?(/Authenticating\.\.\.\nOK/m) end |
#contains?(text) ⇒ Boolean
7 8 9 |
# File 'lib/cf_script/output/tests.rb', line 7 def contains?(text) out.contains?(text) end |
#credentials_rejected? ⇒ Boolean
35 36 37 |
# File 'lib/cf_script/output/tests.rb', line 35 def credentials_rejected? contains? 'Credentials were rejected' end |
#failed? ⇒ Boolean
19 20 21 |
# File 'lib/cf_script/output/tests.rb', line 19 def failed? contains? 'FAILED' end |
#is_already?(name, state) ⇒ Boolean
43 44 45 |
# File 'lib/cf_script/output/tests.rb', line 43 def is_already?(name, state) out.last_line_matches?(/#{name} is already #{state}/) end |
#matches?(regexp) ⇒ Boolean
3 4 5 |
# File 'lib/cf_script/output/tests.rb', line 3 def matches?(regexp) out.matches?(regexp) end |
#no_api_endpoint? ⇒ Boolean
23 24 25 |
# File 'lib/cf_script/output/tests.rb', line 23 def no_api_endpoint? contains? 'No API endpoint set' end |
#not_authorized? ⇒ Boolean
31 32 33 |
# File 'lib/cf_script/output/tests.rb', line 31 def contains? 'You are not authorized' end |
#not_found?(type, name) ⇒ Boolean
39 40 41 |
# File 'lib/cf_script/output/tests.rb', line 39 def not_found?(type, name) out.last_line_matches?(/#{type} #{name} not found/) end |
#not_logged_in? ⇒ Boolean
27 28 29 |
# File 'lib/cf_script/output/tests.rb', line 27 def not_logged_in? contains? 'Not logged in' end |
#ok? ⇒ Boolean
11 12 13 |
# File 'lib/cf_script/output/tests.rb', line 11 def ok? out.last_line_matches?(/^OK$/) end |