---
- name: install package check mode
  win_scoop:
    name: '{{ test_scoop_package1 }}'
  check_mode: yes
  register: install_check

- name: assert install package check mode
  assert:
    that:
      - install_check is changed
      - install_check.stdout is not defined

- name: install package locally
  win_scoop:
    name: '{{ test_scoop_package1 }}'
  register: install_locally

- name: assert install package locally
  assert:
    that:
      - install_locally is changed

- name: install package locally (idempotent)
  win_scoop:
    name: '{{ test_scoop_package1 }}'
  register: install_idempotent

- name: assert install package locally (idempotent)
  assert:
    that:
      - not install_idempotent is changed

- name: install package globally
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    global: yes
  register: install_globally

- name: assert install package globally
  assert:
    that:
      - install_globally is changed

- name: install package globally
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    global: yes
  register: install_globally_idempotent

- name: assert install package globally (idempotent)
  assert:
    that:
      - not install_globally_idempotent is changed

- name: remove package
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    state: absent
  register: remove

- name: assert remove package
  assert:
    that:
      - remove is changed

- name: remove package (idempotent)
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    state: absent
  register: remove_idempotent

- name: assert remove package (idempotent)
  assert:
    that:
      - not remove_idempotent is changed

- name: remove package globally
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    state: absent
    global: yes
  register: remove_globally

- name: assert remove package
  assert:
    that:
      - remove_globally is changed

- name: remove package globally (idempotent)
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    state: absent
    global: yes
  register: remove_globally_idempotent

- name: assert remove package globally (idempotent)
  assert:
    that:
      - not remove_globally_idempotent is changed

- name: install package before check mode test
  win_scoop:
    name: '{{ test_scoop_package1 }}'

- name: remove package check mode
  win_scoop:
    name: '{{ test_scoop_package1 }}'
    state: absent
  check_mode: yes
  register: remove_check

- name: assert remove package check mode
  assert:
    that:
      - remove_check is changed
      - remove_check.stdout is not defined

- name: install multiple packages locally
  win_scoop:
    name: '{{ test_scoop_packages }}'
  register: install_multiple

- name: assert install multiple packages locally
  assert:
    that:
      - install_multiple is changed

- name: install multiple packages locally (idempotent)
  win_scoop:
    name: '{{ test_scoop_packages }}'
  register: install_multiple_idempotent

- name: assert install multiple packages locally (idempotent)
  assert:
    that:
      - not install_multiple_idempotent is changed

- name: remove multiple packages locally
  win_scoop:
    name: '{{ test_scoop_packages }}'
    state: absent
  register: remove_multiple

- name: assert remove multiple packages
  assert:
    that:
      - remove_multiple is changed

- name: remove multiple packages locally (idempotent)
  win_scoop:
    name: '{{ test_scoop_packages }}'
    state: absent
  register: remove_multiple_idempotent

- name: remove multiple packages locally (idempotent)
  assert:
    that:
      - not remove_multiple_idempotent is changed
