diff options
author | Claire McQuin <claire@getchef.com> | 2014-10-30 16:09:29 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-10-30 16:09:29 -0700 |
commit | 59235ae3d772f136e90017c333368887c25e2de8 (patch) | |
tree | 284afc57fd0b2129e5a7517906444339ac282946 /spec/unit/plugins/go_spec.rb | |
parent | 02b2a8687297e8c4fe4f57e41f1854bbcda47fb3 (diff) | |
download | ohai-59235ae3d772f136e90017c333368887c25e2de8.tar.gz |
Convert specs to RSpec 3.1.7 syntax with Transpec
This conversion is done by Transpec 2.3.7 with the following command:
transpec
* 1156 conversions
from: obj.should
to: expect(obj).to
* 928 conversions
from: == expected
to: eq(expected)
* 551 conversions
from: obj.stub(:message)
to: allow(obj).to receive(:message)
* 226 conversions
from: obj.should_receive(:message)
to: expect(obj).to receive(:message)
* 65 conversions
from: obj.should_not
to: expect(obj).not_to
* 19 conversions
from: obj.should_not_receive(:message)
to: expect(obj).not_to receive(:message)
* 11 conversions
from: lambda { }.should
to: expect { }.to
* 3 conversions
from: Klass.any_instance.should_receive(:message)
to: expect_any_instance_of(Klass).to receive(:message)
* 3 conversions
from: lambda { }.should_not
to: expect { }.not_to
* 3 conversions
from: obj.stub_chain(:message1, :message2)
to: allow(obj).to receive_message_chain(:message1, :message2)
For more details: https://github.com/yujinakayama/transpec#supported-conversions
Diffstat (limited to 'spec/unit/plugins/go_spec.rb')
-rw-r--r-- | spec/unit/plugins/go_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/plugins/go_spec.rb b/spec/unit/plugins/go_spec.rb index c6658d8a..cdfbb914 100644 --- a/spec/unit/plugins/go_spec.rb +++ b/spec/unit/plugins/go_spec.rb @@ -21,24 +21,24 @@ describe Ohai::System, "plugin go" do @plugin = get_plugin("go") @plugin[:languages] = Mash.new @stdout = "go version go1.1.2 darwin/amd64\n" - @plugin.stub(:shell_out).with("go version").and_return(mock_shell_out(0, @stdout, "")) + allow(@plugin).to receive(:shell_out).with("go version").and_return(mock_shell_out(0, @stdout, "")) end it "should get the go version" do - @plugin.should_receive(:shell_out).with("go version").and_return(mock_shell_out(0, @stdout, "")) + expect(@plugin).to receive(:shell_out).with("go version").and_return(mock_shell_out(0, @stdout, "")) @plugin.run end it "should set languages[:go][:version]" do @plugin.run - @plugin.languages[:go][:version].should eql("1.1.2") + expect(@plugin.languages[:go][:version]).to eql("1.1.2") end it "should not set the languages[:go] tree up if go command fails" do @stdout = "go version go1.1.2 darwin/amd64\n" - @plugin.stub(:shell_out).with("go version").and_return(mock_shell_out(1, @stdout, "")) + allow(@plugin).to receive(:shell_out).with("go version").and_return(mock_shell_out(1, @stdout, "")) @plugin.run - @plugin.languages.should_not have_key(:go) + expect(@plugin.languages).not_to have_key(:go) end end |