gem_module: Integration tests for bindir option

This commit is contained in:
Stanislav German-Evtushenko 2021-06-19 16:41:35 +09:00
commit 253c1ed98b

View file

@ -178,3 +178,40 @@
that:
- install_gem_result is changed
- gem_search.files | length == 0
# Custom directory for executables (--bindir)
- name: Install gem with custom bindir
gem:
name: gist
state: present
bindir: "{{ output_dir }}/custom_bindir"
register: install_gem_result
- name: Get stats of gem executable
stat:
path: "{{ output_dir }}/custom_bindir/gist"
register: gem_bindir_stat
- name: Ensure gem executable was installed in custom directory
assert:
that:
- install_gem_result is changed
- gem_bindir_stat.stat.exists and gem_bindir_stat.stat.isreg
- name: Remove gem with custom bindir
gem:
name: gist
state: absent
bindir: "{{ output_dir }}/custom_bindir"
register: install_gem_result
- name: Get stats of gem executable
stat:
path: "{{ output_dir }}/custom_bindir/gist"
register: gem_bindir_stat
- name: Ensure gem executable was removed from custom directory
assert:
that:
- install_gem_result is changed
- not gem_bindir_stat.stat.exists