Skip to content

Commit d8e6f02

Browse files
author
rwang
committed
even more awesome rspec
1 parent d7b6767 commit d8e6f02

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The full functionality of this module requires Hiera.
77
To simply ensure that one or more Ruby versions are installed, use the base `ruby` class with an array of Ruby Software Collections names:
88

99
```
10-
class { ruby:
10+
class { ruby:
1111
$rubies => [ 'ruby200', 'rh-ruby22', ],
1212
}
1313
```
@@ -31,7 +31,7 @@ Gems can be installed system-wide on a per-Ruby basis.
3131
}
3232
```
3333

34-
Any Gem executable (binary or script) will be installed into `/opt/rh/<ruby>/root/usr/local/bin`, and that directory will be added to the `PATH` environment variable inside the relevant Software Collection enable script. This ensures that Gem executables will be available when the Software Collection is enabled.
34+
Any Gem executable (binary or script) will be installed into `/opt/rh/<ruby>/root/usr/local/bin`, and that directory will be added to the `PATH` environment variable inside the relevant Software Collection enable script. This ensures that Gem executables will be available when the Software Collection is enabled.
3535

3636
The default Gem installation options include `--no-ridoc` and `--no-rdoc`. If you wish to install documentation, you may do so:
3737
```
@@ -86,6 +86,13 @@ The default for SCL gems is to pass `--no-ridoc` and `--no-rdoc` to the installa
8686
ridoc: true
8787
rdoc: true
8888

89+
## Running Tests
90+
91+
To run the Puppet spec tests, you will need to run the setup rake task first:
92+
93+
1. `rake spec_clean && rake spec_prep` to set up your environment, *especially* if you updated .fixtures.yml
94+
2. `rake spec` from current directory to start the test
95+
8996
# Contributing
9097
Pull requests are warmly welcomed!
9198

spec/classes/ruby_spec.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@
2929

3030
context 'multiple ruby envs enablement with reverse order of the array' do
3131
let :params do
32-
{ :rubies => [ 'rh-ruby26', 'rh-ruby22', 'rh-ruby24', 'rh-ruby20' ] }
32+
{ :rubies => [ 'rh-zzoriginalfirstelement', 'rh-ruby22', 'rh-ruby24', 'rh-aaoriginallastelement' ] }
3333
end
34+
it { is_expected.to contain_concat("/etc/profile.d/scl-ruby.sh") }
35+
it { is_expected.to contain_concat__fragment("rh-aaoriginallastelement").with(
36+
'order' => 0,
37+
)}
3438
it { is_expected.to contain_concat__fragment("rh-ruby24").with(
35-
'source' => '/opt/rh/rh-ruby24/enable',
36-
'target' => '/etc/profile.d/scl-ruby.sh',
3739
'order' => 1,
3840
)}
39-
4041
it { is_expected.to contain_concat__fragment("rh-ruby22").with(
41-
'source' => '/opt/rh/rh-ruby22/enable',
42-
'target' => '/etc/profile.d/scl-ruby.sh',
4342
'order' => 2,
4443
)}
44+
it { is_expected.to contain_concat__fragment("rh-zzoriginalfirstelement").with(
45+
'order' => 3,
46+
)}
4547
end
4648
end

0 commit comments

Comments
 (0)