spec/integration_spec.rb in mrjoy-bundler-audit-0.3.4 vs spec/integration_spec.rb in mrjoy-bundler-audit-0.3.5

- old
+ new

@@ -58,9 +58,30 @@ expect(subject).to include("Unpatched versions found!") end end end + context "when displaying bundler-audit version" do + let(:bundle) { 'unpatched_gems' } + let(:directory) { File.join('spec','bundle',bundle) } + + let(:command) do + File.expand_path('../bundle/wrapper.rb', __FILE__) + " version" + end + + subject do + # Ignoring failure here as bundle-audit version seems to return a + # non-zero status, and + Dir.chdir(directory) { sh(command, :fail => false) } + end + + it "should show the version and number of known advisories" do + # It prints a name based on $0, so our wrapper mucks up the display in a + # predictable way. + subject.should match(/^wrapper\.rb #{Regexp.quote('0.3.4')} \(advisories: \d+\)/) + end + end + context "when auditing a bundle with ignored gems" do let(:bundle) { 'unpatched_gems' } let(:directory) { File.join('spec','bundle',bundle) } let(:command) do