Sha256: ecf3f84a61f01beb89a5b2cafd3d8e28e3f27a12dd313ba21b6928f9c5b85629

Contents?: true

Size: 909 Bytes

Versions: 7

Compression:

Stored size: 909 Bytes

Contents

require 'test_helper'
require 'pushapp/remote'

class RemoteTest < MiniTest::Unit::TestCase

  def setup
    remote_options = {
      default_option: 5,
      env: {RAILS_ENV: 'production'}
    }
    @remote = Pushapp::Remote.new('test', nil, 'tmp', Pushapp::Config.new, remote_options)
  end

  def test_task_options_override_remote_options
    @remote.on :push do
      rake('test1', task_option: 'task option', env: {RAILS_ENV: 'test'})
      rake('test2')
    end

    task1 = @remote.tasks_on(:push).first

    assert task1
    assert task1.options[:task_option] == 'task option'
    assert task1.options[:default_option] == 5
    assert task1.options[:env][:RAILS_ENV] == 'test'

    task2 = @remote.tasks_on(:push).last

    assert task2
    assert task2.options[:task_option] == nil
    assert task2.options[:default_option] == 5
    assert task2.options[:env][:RAILS_ENV] == 'production'
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pushapp-0.2.10 test/pushapp/remote_test.rb
pushapp-0.2.9 test/pushapp/remote_test.rb
pushapp-0.2.8 test/pushapp/remote_test.rb
pushapp-0.2.7 test/pushapp/remote_test.rb
pushapp-0.2.6 test/pushapp/remote_test.rb
pushapp-0.2.5 test/pushapp/remote_test.rb
pushapp-0.2.4 test/pushapp/remote_test.rb