Class: LearnTest::Strategies::Jasmine
Instance Attribute Summary
#options, #runner
Instance Method Summary
collapse
#argv, #configure, #die, #initialize, #output, #run_install
Instance Method Details
#check_dependencies ⇒ Object
#cleanup ⇒ Object
56
57
58
59
60
61
62
|
# File 'lib/learn_test/strategies/jasmine.rb', line 56
def cleanup
test_xml_files.each do |file|
FileUtils.rm(file)
end
FileUtils.rm_rf("#{Dir.pwd}/tmpTestSupport") if !browser?
end
|
#detect ⇒ Object
10
11
12
|
# File 'lib/learn_test/strategies/jasmine.rb', line 10
def detect
runner.files.include?('requires.yml')
end
|
#learn_oauth_token ⇒ Object
72
73
74
|
# File 'lib/learn_test/strategies/jasmine.rb', line 72
def learn_oauth_token
options[:skip] ? nil : super
end
|
#push_results? ⇒ Boolean
52
53
54
|
# File 'lib/learn_test/strategies/jasmine.rb', line 52
def push_results?
!local? && !browser?
end
|
#results ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/learn_test/strategies/jasmine.rb', line 33
def results
@results ||= {
username: username,
github_user_id: user_id,
learn_oauth_token: learn_oauth_token,
repo_name: runner.repo,
build: {
test_suite: [{
framework: 'jasmine',
formatted_output: [],
duration: 0.0
}]
},
tests: 0,
errors: 0,
failures: 0
}
end
|
#run ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/learn_test/strategies/jasmine.rb', line 18
def run
require 'crack'
require 'erb'
require 'yaml'
require 'json'
if options[:init]
LearnTest::Jasmine::Initializer.run
else
set_up_runner
run_jasmine
make_json
end
end
|
#service_endpoint ⇒ Object
6
7
8
|
# File 'lib/learn_test/strategies/jasmine.rb', line 6
def service_endpoint
'/e/flatiron_jasmine'
end
|
#user_id ⇒ Object
68
69
70
|
# File 'lib/learn_test/strategies/jasmine.rb', line 68
def user_id
options[:skip] ? "none" : super
end
|
#username ⇒ Object
64
65
66
|
# File 'lib/learn_test/strategies/jasmine.rb', line 64
def username
options[:skip] ? "jasmine-flatiron" : super
end
|