Class: RoxClient::RSpec::Client
- Inherits:
-
Object
- Object
- RoxClient::RSpec::Client
- Defined in:
- lib/rox-client-rspec/client.rb
Instance Method Summary collapse
-
#initialize(server, options = {}) ⇒ Client
constructor
A new instance of Client.
- #process(test_run) ⇒ Object
Constructor Details
#initialize(server, options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rox-client-rspec/client.rb', line 6 def initialize server, = {} @server = server @publish, @local_mode, @workspace = [:publish], [:local_mode], [:workspace] @cache_payload, @print_payload, @save_payload = [:cache_payload], [:print_payload], [:save_payload] = { workspace: @workspace } .merge! server_name: @server.name, project_api_id: @server.project_api_id if @server @cache = Cache.new @uid = UID.new workspace: @workspace end |
Instance Method Details
#process(test_run) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rox-client-rspec/client.rb', line 19 def process test_run puts return fail "No server to publish results to" if !@server test_run.uid = @uid.load_uid = @server. cache_enabled = @cache_payload && load_cache [:cache] = @cache if cache_enabled return false unless payload = build_payload(test_run, ) published = if !@publish puts Paint["ROX - Publishing disabled", :yellow] false elsif publish_payload payload @cache.save test_run if cache_enabled true else false end save_payload payload if @save_payload print_payload payload if @print_payload published end |