module-puppetlabs-mysql/spec/unit/facter/mysql_version_spec.rb
Travis Fields 3ce8ad3799 (maint) - Add a fact for capturing the mysql version installed
- Add spec test for mysql_version fact
- Add `mysql_version` fact to README
2015-05-08 08:51:38 -07:00

20 lines
445 B
Ruby

require "spec_helper"
describe Facter::Util::Fact do
before {
Facter.clear
}
describe "mysql_version" do
context 'with value' do
before :each do
Facter::Util::Resolution.stubs(:exec).with('mysql --version').returns('mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu (x86_64) using readline 5.1')
end
it {
expect(Facter.fact(:mysql_version).value).to eq('5.0.95')
}
end
end
end