Tagging testing question #2388

gregory-m opened this Issue Mar 12, 2013 · 4 comments


None yet

2 participants


Hi, I like to add option to sign git release tags with gpg. It's simple you just need add -s key to git tag command.

I want to Implement it this way: if you have gpg installed and have private key for email, used in git in you keyring, sign tag with gpg, if not don't sign. This is also easy to implement.

But I don't see any spec for git tags here: https://github.com/carlhuda/bundler/blob/master/spec/bundler/gem_helper_spec.rb#L156

The question is how I test it? Should I mock system call with something like this:

Kernel.should_receive(:system).with('git tag -s ......')

Or I should write integration test e.g. run actually programs? In this case how it should be tested if gpg not available on developer machine or on CI server? And how case then gpg not available should be tested on box with gpg installed?



I'm not really sure... we can probably install gpg on the CI server if we need to. You can use RSpec's tags to tag the tests and exclude them if gpg isn't present.

Maybe you can write your own code to do it for now, and send a pull request once it satisfies the requirements you listed?


Sure I will write code.

I understand correctly, what I should test it using integration tests?


If you can figure out how to test it using an integration test, that would be awesome. It also needs to be enabled by a setting, rather than enabled automatically, to stick to SemVer. Probably something like:

it "should sign tags if configured" do
  bundle "config gem_helper.sign_tags true"
  expect(`git tag -n v1.0.0`).to include("signed gem")

Ok. Thank you.

@gregory-m gregory-m closed this Mar 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment