Skip to content

Commit

Permalink
Add a few more tests around Octokit integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankshearar committed Jun 12, 2013
1 parent 4aae83a commit 6fa5b0a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/octoherder/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def self.parse_argv(args)

def self.run(args)
opts = parse_argv(args)
CLI.new.run Octokit.new(octoauth(opts)), opts
kitty = Octokit.new(octoauth(opts))
CLI.new.run kitty, opts
end

def self.octoauth cli_opts
Expand Down
16 changes: 16 additions & 0 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,21 @@ def run(args, octokit_connection)
end
end
end

context "Octokit integration" do
it "should be able to run to completion" do
expect {
c = CLI.run ["--repo", "frankshearar/octoherder"]
}.to raise_error(SystemExit)
end

it "should translate command line arguments into Octokit authorization credentials" do
input = {user: 'me', password: 'password', user_given: true, password_given: true}
output = CLI.octoauth input
expect(output).to eq({login: 'me', password: 'password'})
end

it "should pass through the OAuth token"
end
end
end

0 comments on commit 6fa5b0a

Please sign in to comment.