From 817f33a2a1e8f78720f5e73a10ee45384e886ae9 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Fri, 13 Nov 2015 16:31:02 -0500 Subject: githubrepo hook spec --- spec/githubrepo_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/githubrepo_spec.rb (limited to 'spec') diff --git a/spec/githubrepo_spec.rb b/spec/githubrepo_spec.rb new file mode 100644 index 0000000..c98244d --- /dev/null +++ b/spec/githubrepo_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' +require 'rugged' +require 'oxidized/hook/githubrepo' + +describe Oxidized::Node do + before(:each) do + asetus = Asetus.new + asetus.cfg.output.git.repo = 'foo.git' + Oxidized.stubs(:asetus).returns(asetus) + repo = mock() + remote = mock() + remote.expects(:url).returns('github.com/foo.git') + remote.expects(:push).returns(true) + repo.expects(:remotes).returns({'origin' => remote}) + repo.expects(:path).returns('foo.git') + Rugged::Repository.expects(:new).with('foo.git').returns(repo) + end + + describe "#run_hook" do + it "will push to the remote repository" do + gr = GithubRepo.new + gr.run_hook(nil).must_equal true + end + end +end -- cgit v1.2.1