Class: Typingpool::Test

Inherits:
Minitest::Test
  • Object
show all
Includes:
Utility::Test
Defined in:
lib/typingpool/test.rb,
lib/typingpool/test/script.rb

Direct Known Subclasses

Script

Defined Under Namespace

Classes: Script

Class Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utility::Test

#add_goodbye_message, #amazon_credentials?, #audio_dir, #broken_url_eventually?, #cleared_vcr_fixture_path_for, #config, #delete_vcr_fixture, #dummy_config, #fixtures_dir, #project_default, #s3_credentials?, #sftp_credentials?, #vcr_core_host_matcher, #vcr_dir, #vcr_load, #vcr_stop, #with_vcr, #working_url_eventually?, #works_eventually?

Class Attribute Details

.liveObject

Returns the value of attribute live.



9
10
11
# File 'lib/typingpool/test.rb', line 9

def live
  @live
end

.recordObject

Returns the value of attribute record.



10
11
12
# File 'lib/typingpool/test.rb', line 10

def record
  @record
end

Instance Method Details

#skip_during_vcr_playback(skipping_what = '') ⇒ Object



42
43
44
# File 'lib/typingpool/test.rb', line 42

def skip_during_vcr_playback(skipping_what='')
  skip_with_message("Runs only with --live or --record option", skipping_what) unless (Typingpool::Test.live || Typingpool::Test.record)
end

#skip_if_no_amazon_credentials(skipping_what = '', config = self.config) ⇒ Object



22
23
24
25
26
# File 'lib/typingpool/test.rb', line 22

def skip_if_no_amazon_credentials(skipping_what='', config=self.config)
  if not (amazon_credentials?(config))
    skip_with_message('Missing or incomplete Amazon credentials', skipping_what)
  end
end

#skip_if_no_s3_credentials(skipping_what = '', config = self.config) ⇒ Object



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

def skip_if_no_s3_credentials(skipping_what='', config=self.config)
  if not (skip_if_no_amazon_credentials(skipping_what, config))
    if not(s3_credentials?(config))
      skip_with_message('No Amazon S3 credentials', skipping_what)
    end #if not(s3_credentials?...)
  end #if not(skip_if_no_amazon_credentials...)
end

#skip_if_no_sftp_credentials(skipping_what = '', config = self.config) ⇒ Object



36
37
38
39
40
# File 'lib/typingpool/test.rb', line 36

def skip_if_no_sftp_credentials(skipping_what='', config=self.config)
  if not(sftp_credentials?(config))
    skip_with_message('No SFTP credentials', skipping_what)
  end #if not(sftp_credentials?...
end

#skip_if_no_upload_credentials(skipping_what = '', config = self.config) ⇒ Object



46
47
48
49
50
# File 'lib/typingpool/test.rb', line 46

def skip_if_no_upload_credentials(skipping_what='', config=self.config)
  if not(s3_credentials?(config) || sftp_credentials?(config))
    skip_with_message("No S3 or SFTP credentials in config", skipping_what)
  end #if not(s3_credentials?...
end

#skip_with_message(reason, skipping_what = '') ⇒ Object



16
17
18
19
20
# File 'lib/typingpool/test.rb', line 16

def skip_with_message(reason, skipping_what='')
  skipping_what = " #{skipping_what}" unless skipping_what.empty?
  skip ("Skipping#{skipping_what}: #{reason}")
  true
end