diff options
| author | Dickson S. Guedes | 2011-09-28 03:50:49 +0000 |
|---|---|---|
| committer | Dickson S. Guedes | 2011-09-28 03:50:49 +0000 |
| commit | fcea520370dd07d84e07660a09e2baf5ed8e4b31 (patch) | |
| tree | 818ec641d2db7d85e870d2c18dde4e17b491e5e8 /spec/cli_spec.rb | |
| parent | 9602960da44eb35f608d1fadac6a4c6e60f22e1e (diff) | |
added initial git support. ref #16
Diffstat (limited to 'spec/cli_spec.rb')
| -rw-r--r-- | spec/cli_spec.rb | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 590d291..8be3073 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -14,14 +14,15 @@ describe PgxnUtils::CLI do context "#skeleton" do before(:each) do - @cli = PgxnUtils::CLI.new + system "rm -rf /tmp/extension.*" + system "rm -rf extension.*" end it "should accepts or not a target" do expected_extension = next_extension File.should_not exist(expected_extension) - skeleton "#{expected_extension}", "-p /tmp" + skeleton "#{expected_extension}", %w|-p /tmp| File.should exist("/tmp/#{expected_extension}") File.should_not exist(expected_extension) @@ -35,10 +36,9 @@ describe PgxnUtils::CLI do expected_mail = "guedes@none.here" expected_abstract = "Short description" expected_description = "Very Long description for my cool extension" - expected_tags = "one two tree" expected_version = "1.0.0" - skeleton expected_extension, "-p /tmp -m #{expected_name} -e #{expected_mail} -t #{expected_tags} -a '#{expected_abstract}' -d '#{expected_description}' -v #{expected_version}" + skeleton expected_extension, %W|-p /tmp -m #{expected_name} -e #{expected_mail} -t one two tree -a #{expected_abstract} -d #{expected_description} -v #{expected_version}| meta = File.read("/tmp/#{expected_extension}/META.json") meta.should match(/"name": "#{expected_extension}"/) @@ -86,7 +86,21 @@ describe PgxnUtils::CLI do ].sort end - it "should generates a git repo" + it "should generates a git repo with --git" do + expected_extension = next_extension + skeleton "#{expected_extension}", %w|--git| + + File.should exist("#{expected_extension}/.git") + lambda{ Grit::Repo.new(expected_extension) }.should_not raise_error + end + + it "should not generates a git repo with --no-git" do + expected_extension = next_extension + skeleton "#{expected_extension}", %w|--no-git| + + File.should_not exist("#{expected_extension}/.git") + lambda{ Grit::Repo.new(expected_extension) }.should raise_error + end end context "#change" do |
