55 Commits

Author SHA1 Message Date
Yossef Mendelssohn
535a9faf5f Refactor CLI#run tests
Now I can just stub `CLI#process` instead of caring what happens inside
it.

cf f0a9ad99e0
2012-10-05 15:50:51 -04:00
Yossef Mendelssohn
455ffb919b Fix repeated test definitions
Oh hey maybe I wanted to have two more tests instead of redefining a
couple.

MAYBE.
2012-10-05 15:48:03 -04:00
Yossef Mendelssohn
ea7719caa1 report → reporter
It makes more sense this way. I was trying too hard on the length
instead of the content.
2012-10-05 15:39:18 -04:00
Yossef Mendelssohn
66c4796f3e Don't affect issues unless it's wanted 2012-10-05 02:16:55 -04:00
Yossef Mendelssohn
1a1070f04e Check for whether issues should be affected 2012-10-05 02:14:33 -04:00
Yossef Mendelssohn
6c879a8dc4 Give CLI a Checkout, too
It'll need this to check for master branch.

It's all coming together.
2012-10-05 02:05:41 -04:00
Yossef Mendelssohn
e1a5da7a55 Move master? from Config to Checkout
It belongs with sha/changes/dirty?, and you know it.
2012-10-05 02:04:17 -04:00
Yossef Mendelssohn
988c9803bb Report failure/success of CLI#run
There's some repetition I'm not sure about here. I went with what the
comment said, though.
2012-10-05 01:56:54 -04:00
Yossef Mendelssohn
71edf89ddf Add Reporter to CLI 2012-10-05 01:42:16 -04:00
Yossef Mendelssohn
8d97b2f15a Reporter tests stubs → Structs
So much easier to read and deal with.

My variable name choice is becoming questionable.
2012-10-05 01:35:31 -04:00
Yossef Mendelssohn
7445eb957c Use actual objects in Reporter tests
API and Puppet can be opaque to this test, as Puppet is only used for
the command and I don't want to (yet) mess with different sort of API
testing. Config/Checkout, on the other hand, are related more closely
and have some related logic I don't want to continue stubbing.

More stubbing could be exchanged with attr_writer use (like what I
added for Config), except those methods don't use ivars.
2012-10-05 01:25:47 -04:00
Yossef Mendelssohn
3e8bb436c2 Use actual Config object in Checkout tests
This makes it more difficult to test (or at least pretend to test) the
`Dir.chdir` use in `sha` and `changes`.

I'm okay with that.
2012-10-05 01:10:41 -04:00
Yossef Mendelssohn
a9c459dcb4 Explicitly set success for stubbed system call
There's a test that checks for this being false, but these tests just
assume it'll be true.
2012-10-05 01:02:17 -04:00
Yossef Mendelssohn
a35b136ea6 Actually set ENV vars in tests
I'll allow mock/stubbing on a lot of things, but I draw the line with
`ENV.expects(:[]).with('THIS').returns('that')`. Let's not be crazy.

Not that this pattern is so very much better. It's just actually
setting the values and using them, like the code is supposed to do.
2012-10-05 00:41:28 -04:00
Yossef Mendelssohn
71fadf88a7 Move sha from Reporter to Checkout 2012-10-04 23:37:45 -04:00
Yossef Mendelssohn
96b8f94111 Add comment when auto-closing issues 2012-10-04 23:32:20 -04:00
Yossef Mendelssohn
9c73e9104d Can label ongoing failures to leave them open 2012-10-04 23:23:42 -04:00
Yossef Mendelssohn
0caeeb14b4 Reporter can also close failures
This refers to the auto-opened failures, so we're looking for open
issues on this repo created by the same user and having the failure
label.
2012-10-04 23:15:14 -04:00
Yossef Mendelssohn
688d7aed8b actually use custom failure label in test 2012-10-04 22:54:36 -04:00
Yossef Mendelssohn
e02a63cdb9 Remove changes/dirty? from Config 2012-10-04 22:45:22 -04:00
Yossef Mendelssohn
821e30aa3a Use changes from Checkout instead of Config 2012-10-04 22:44:33 -04:00
Yossef Mendelssohn
e82f191f7f chdir when checking local changes
This seems like an oversight in the original code.
2012-10-04 22:40:38 -04:00
Yossef Mendelssohn
6926afea96 Add Boxen::Checkout
This class handles the local checkout of the boxen/boxen repo. Y'know,
things like saying whether there are changes.
2012-10-04 22:38:03 -04:00
Yossef Mendelssohn
10ca468bc1 Make failure label customizable 2012-10-04 22:27:56 -04:00
Yossef Mendelssohn
bf97e2b7a4 Add puppet command to failure details
Now the Reporter needs to know about the Puppeteer as well.

I'm not sure how I feel about a method called `command` returning an
array and consumers of that method needing to know to join it. On the
other hand, I don't really want to have a method called
`command_string`. It's kind of a dumb name.

It also makes the mock objects used in the tests more hairy, but those
should be ripped out and replaced with actual objects soon enough.
2012-10-04 17:53:51 -04:00
Yossef Mendelssohn
484e2c9df9 add failure label to created issue
We may want to make this label configurable, and also create it if
necessary.
2012-10-04 16:47:15 -04:00
Yossef Mendelssohn
e67995526a Add log to failure details
Adding Reporter#log and tests.
2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
f846c5e7d7 Add changes to failure details 2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
acfe3095ec Add Config#changes and tests for it and #dirty? 2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
cbc429959f Add Reporter#failure_details
Starting this off, more details forthcoming.
2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
b06c33434b Add Reporter#record_failure 2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
36998d075c Test Config#api 2012-10-04 14:59:19 -04:00
John Barnette
4e051a10c4 Start extracting/porting a Boxen::Reporter 2012-10-03 21:59:16 -07:00
John Barnette
d00ea25ee3 Add Config#reponame 2012-10-03 21:36:06 -07:00
Mike Skalnik
6c8cfc5fb1 Merge pull request #7 from boxen/add-preflight-tests
Add preflight tests
2012-10-03 19:53:30 -07:00
Will Farrington
1002900cbd add assertion for group flag in puppet run 2012-10-03 16:49:38 -07:00
John Barnette
857a9655c6 Merge pull request #6 from boxen/add_token_to_config
first spike
2012-10-03 13:11:18 -07:00
Mike Skalnik
0f5ad6d8fa Add test around /etc/my.cnf Preflight 2012-10-03 15:51:12 -04:00
Mike Skalnik
ff74cb94e6 Add test around Homebrew preflight 2012-10-03 15:39:38 -04:00
John Barnette
7821aac009 Add token to Boxen::Config 2012-10-03 12:29:43 -07:00
Mike Skalnik
ae4a3a31cf Check Preflight::RVM#ok? return as well 2012-10-03 15:28:18 -04:00
Mike Skalnik
e79a955ffd Add Preflight RVM test 2012-10-03 13:30:02 -04:00
John Barnette
32bca15a65 Handle tmpdirs and logfiles a bit better 2012-10-02 18:30:35 -07:00
John Barnette
1b735cd3fc Boxen.run -> Boxen::CLI.run 2012-10-02 16:24:46 -07:00
John Barnette
d8eaba3899 Stub CLI and extract Boxen::Util 2012-10-02 16:16:23 -07:00
John Barnette
61780340fd Add preflights and postflights 2012-10-02 14:33:25 -07:00
John Barnette
96831386b3 Use config.repodir effectively 2012-10-02 13:35:35 -07:00
John Barnette
8736b752e6 Add Config#repodir 2012-10-02 13:29:48 -07:00
John Barnette
487545cf3a Add helpers to check active state and run sudo 2012-10-02 09:57:41 -07:00
John Barnette
1080e8086f Add a (kinda broken) Puppet wrapper 2012-10-02 09:51:54 -07:00