diff options
author | Theodore Nordsieck <theo@opscode.com> | 2013-08-21 17:50:32 -0700 |
---|---|---|
committer | Theodore Nordsieck <theo@opscode.com> | 2013-08-22 11:06:29 -0700 |
commit | cf6582cc21d5d29d33ee86563411ad9d8940c8f2 (patch) | |
tree | 2c312e8281edaaf825365ec94aa78d5961ae0d7e | |
parent | 798da58011d1b9e171169f7d324680bd0064e3e6 (diff) | |
download | ohai-cf6582cc21d5d29d33ee86563411ad9d8940c8f2.tar.gz |
changed formatting of output
-rw-r--r-- | spec/unit/path/ohai_plugin_common.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/unit/path/ohai_plugin_common.rb b/spec/unit/path/ohai_plugin_common.rb index 88a62755..54cf4325 100644 --- a/spec/unit/path/ohai_plugin_common.rb +++ b/spec/unit/path/ohai_plugin_common.rb @@ -166,9 +166,9 @@ def test_plugin(plugin_names, cmd_list) platforms.each do |platform| describe "when the platform is #{platform}" do archs.each do |arch| - describe "when the architecture is #{arch}" do + describe "and the architecture is #{arch}" do envs.each do |env| - describe "when the environment is #{env}" do + describe "and the environment is #{env}" do path = OhaiPluginCommon.get_path cmd_not_found = Set.new @@ -204,8 +204,12 @@ def test_plugin(plugin_names, cmd_list) enc = Yajl::Encoder subsumes?( @ohai.data, ohai ) do | path, source, test | path_txt = path.map { |p| "[#{enc.encode( p )}]" }.join - source_txt = if source.nil? then "nil" else enc.encode( source ) end - it "should set #{path_txt} to #{source_txt}" do + if source.nil? + txt = "should not set #{path_txt}" + else + txt = "should set #{path_txt} to #{enc.encode( source )}" + end + it txt do source.should eq( test ) end end @@ -269,8 +273,12 @@ shared_context "cross platform data" do enc = Yajl::Encoder subsumes?( @ohai.data, e[:ohai] ) do | path, source, test | path_txt = path.map { |p| "[#{enc.encode( p )}]" }.join - source_txt = if source.nil? then "nil" else enc.encode( source ) end - it "should set #{path_txt} to #{source_txt}" do + if source.nil? + txt = "should not set #{path_txt}" + else + txt = "should set #{path_txt} to #{enc.encode( source )}" + end + it txt do source.should eq( test ) end end |