ansible_spec 0.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 250f5355a569c40d24193b19685ecc4d5ad454aa7c60ff445b12503b81a6a23a
4
- data.tar.gz: 3b72c2519bc7600ba81c789b07a3415ac1ebd286d23c0133bdc39dce93ccd47a
3
+ metadata.gz: 2d87ec24d89e985e499037877255f902b7eb7345a4fd4d4af1d262c55287ef9a
4
+ data.tar.gz: 819cc6ef8696ac2dbd09026e00ef05ffea63ccb6ca59a54cea75bb54dce0981d
5
5
  SHA512:
6
- metadata.gz: c8f3fb9cc3861c77526ea9c8d24657550fa4ee1f0f1d74299660765721008af3fd00531b3045e4b72357d527ef6e02d94d3937ef1e486e7749a1d3173fd24f98
7
- data.tar.gz: a0c3454aa81f7c374208ac78e7abd0e2fe95427080f6cd104230e9b22bcea981576c77fbe82bcec489873bf66d258bc420f7427f139053c37ebe2db7172b1ab4
6
+ metadata.gz: 7f59e840375f84b5df3df071cc1e9687734038556c3a6a888c7f8529f710130f337db4161dad2234ef787f0c493bbc88ce2256c19e95cd8e6052d37be478dc8b
7
+ data.tar.gz: 01d38a3d50b2f704351ae2c9f0e33c18d101b85f5c049d6126d66f485e6132634ef6936a3ca7059d7ff53f371cf8296b85f3d4cd2c4d916574850b785c1b445a
@@ -7,9 +7,9 @@ rvm:
7
7
  - 2.1.10
8
8
  - 2.2.10
9
9
  - 2.3.8
10
- - 2.4.6
11
- - 2.5.5
12
- - 2.6.3
13
- - 2.7.0-preview1
10
+ - 2.4.9
11
+ - 2.5.7
12
+ - 2.6.5
13
+ - 2.7.0
14
14
  script:
15
15
  - rspec spec
@@ -1,3 +1,6 @@
1
+ # v0.3.1
2
+ - Fix [#126 no implicit conversion of nil into Array Error when process get_parent](https://github.com/volanja/ansible_spec/issues/126) by [shogos3](https://github.com/shogos3)
3
+
1
4
  # v0.3
2
5
  - Support Ansible Vault (Run Ruby 2.1.0 and higher.)
3
6
  - Merge [#116 Feature ansible vault](https://github.com/volanja/ansible_spec/pull/116) by [RebelCodeBase](https://github.com/RebelCodeBase)
@@ -29,7 +29,7 @@ module AnsibleSpec
29
29
  hosts = Hash.new
30
30
  hosts.default = Hash.new
31
31
  f.each_line{|line|
32
- line = line.chomp
32
+ line = line.strip
33
33
  # skip
34
34
  next if line.start_with?('#') #comment
35
35
  next if line.empty? == true #null
@@ -1,3 +1,3 @@
1
1
  module AnsibleSpec
2
- VERSION = "0.3"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -1801,4 +1801,72 @@ EOF
1801
1801
  File.delete(tmp_hosts)
1802
1802
  end
1803
1803
  end
1804
+
1805
+ context 'Issue 126 Array Error' do
1806
+ require 'yaml'
1807
+ tmp_ansiblespec = '.ansiblespec'
1808
+ tmp_playbook = 'site.yml'
1809
+ tmp_hosts = 'hosts'
1810
+
1811
+ before do
1812
+
1813
+ content = <<'EOF'
1814
+ ---
1815
+ -
1816
+ playbook: site.yml
1817
+ inventory: hosts
1818
+ EOF
1819
+
1820
+ content_p = <<'EOF'
1821
+ - name: Ansible-Sample-TDD-1
1822
+ hosts:
1823
+ - server
1824
+ user: root
1825
+ roles:
1826
+ - role: nginx
1827
+ EOF
1828
+
1829
+ content_h = <<'EOF'
1830
+ [server]
1831
+ host1
1832
+ host2
1833
+ host3
1834
+ host4
1835
+ host5
1836
+ EOF
1837
+
1838
+ create_file(tmp_ansiblespec,content)
1839
+ create_file(tmp_playbook,content_p)
1840
+ create_file(tmp_hosts,content_h)
1841
+ @res = AnsibleSpec.get_properties
1842
+ end
1843
+
1844
+ it 'check 5 hosts' do
1845
+ expect(@res[0]["hosts"].length).to eq 5
1846
+ end
1847
+
1848
+ it 'check host1' do
1849
+ expect(@res[0]["hosts"][0]["name"]).to eq "host1"
1850
+ end
1851
+
1852
+ it 'check host2' do
1853
+ expect(@res[0]["hosts"][1]["name"]).to eq "host2" #not " host2"
1854
+ end
1855
+ it 'check host3' do
1856
+ expect(@res[0]["hosts"][2]["name"]).to eq "host3" #not "host3\t"
1857
+ end
1858
+ it 'check host4' do
1859
+ expect(@res[0]["hosts"][3]["name"]).to eq "host4" #not "\thost4"
1860
+ end
1861
+
1862
+ it 'check host5' do
1863
+ expect(@res[0]["hosts"][4]["name"]).to eq "host5" #not "\thost5\t"
1864
+ end
1865
+
1866
+ after do
1867
+ File.delete(tmp_ansiblespec)
1868
+ File.delete(tmp_playbook)
1869
+ File.delete(tmp_hosts)
1870
+ end
1871
+ end
1804
1872
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansible_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - volanja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-06 00:00:00.000000000 Z
11
+ date: 2020-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -361,8 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
361
  - !ruby/object:Gem::Version
362
362
  version: '0'
363
363
  requirements: []
364
- rubyforge_project:
365
- rubygems_version: 2.7.6
364
+ rubygems_version: 3.1.2
366
365
  signing_key:
367
366
  specification_version: 4
368
367
  summary: Ansible Config Parser for Serverspec. Run test Multi Role and Multi Host