summaryrefslogtreecommitdiff
path: root/spec/githubrepo_spec.rb
diff options
context:
space:
mode:
authorElvin Efendi <elvin.efendiyev@gmail.com>2015-11-16 13:13:08 -0500
committerElvin Efendi <elvin.efendiyev@gmail.com>2015-11-16 13:13:08 -0500
commit937b1f6806caf8f4e0b4397398770ac4e339cdb4 (patch)
tree669ff5b2daed2951db23d5fb5079f7dc6d6039f2 /spec/githubrepo_spec.rb
parent5a2364e50620b825d5325bfbbc5d0f3d8578e25f (diff)
parent817f33a2a1e8f78720f5e73a10ee45384e886ae9 (diff)
Merge pull request #1 from Shopify/github-hook
a callback to push config changes to a remote repository
Diffstat (limited to 'spec/githubrepo_spec.rb')
-rw-r--r--spec/githubrepo_spec.rb25
1 files changed, 25 insertions, 0 deletions
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