Wednesday, July 24, 2013

Grep

We are working on a Bundler Issues

https://github.com/bundler/bundler/issues/2550

grep
We did grep searches to help us find out what our problem with the testing is. We located a bundler.ui.error and went down the rabbit hole to find out what it meant. We used grep in the command line to search for "def ui" because the convention in Ruby is that the name of the Class is the name of the file which makes it much easier to search. After narrowing it down Jessica eventually found that Bundler handles testing differently then how rspec usually works in other projects. Our searching helped her figure out that the problem was not in what we were doing.

grep -r "def ui" .      grep -r recursive "whatever you are searching for" where(in this case all  ".")

http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/

Here is the code I came up with so far with the help of Jessica & the other test files.

Our task: Create a test where "bundle i " does not raise an error
______________________________________

require "spec_helper"
describe "bundle i error" do
   it "should not raise an error" do
     bundle " i "
     expect(err).to be_empty
  end
end
_______________________________________

Create a test that prints a friendly message
_______________________________________

require "spec_helper"
  describe "bundler stuff" do
    it "should explain that bundler needs a specific argument" do
      bundle "i"
      expect(out).to match(/Ambiguous argument. Use bundle --help for a list of commands./i)
    end
end
_______________________________________

These are not working quite right yet but it is what I have so far.

No comments:

Post a Comment