sam / doubleshot

Build and Dependency Management for mixed Java/Ruby projects.
MIT License
19 stars 22 forks source link

Add gemspec#valid? alias for validate. #25

Closed ckrailo closed 11 years ago

ckrailo commented 11 years ago

Makes code/tests prettier.

sam commented 11 years ago

I actually just added a Minitest matcher for #must. So the line is now:

config.gemspec.must :validate

Which I think is good enough.

I also modified Minitest::Assertions#assert_predicate so that if a matching method is not found, but the method with a "?" appended is, then the question-mark method is called. This lets us:

config.target.must :exist

Which executes Pathname#exist? since there is no #exist method.

I'm pretty happy with these tweaks. Don't see a need to monkey-patch Gem::Specification anymore. Feel free to re-open though if you'd like to discuss further.