Skip to content

Commit

Permalink
Merge pull request bsmth#33 from tcob/coverage
Browse files Browse the repository at this point in the history
Coverage
  • Loading branch information
Brian Thomas Smith authored Apr 16, 2018
2 parents feec59e + 4cd55d0 commit 67b00c1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/utils/reacter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'octokit'
require_relative '../config'

# Queries, opens and closes issues in a given repository
class ReactBot
Expand Down
5 changes: 3 additions & 2 deletions lib/utils/reporter.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
require_relative 'queries'
require_relative '../config'
require 'octokit'

Dotenv.load('orgbot.env')

# Simple Console Reporting or usage instructions
class Reporter
def initialize
@prompt = TTY::Prompt.new
@c = Octokit::Client.new(access_token: @t)
@r = ENV['REPO']
@t = ENV['TOKEN']
end

def welcome
puts @c.say("Sup #{Query.new.user}")
c = Octokit::Client.new(access_token: @t)
puts c.say("Sup #{Query.new.user}")
puts "\n🤖 Welcome to GitHub Simulator!"\
'Select how and when you would like to commit to GitHub:'
end
Expand Down
2 changes: 2 additions & 0 deletions test/suite.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
require_relative 'test_helper'
require_relative 'test_branches'
require_relative 'test_committer'
require_relative 'test_config'
require_relative 'test_dotenv'
require_relative 'test_issues'
require_relative 'test_pull_requests'
require_relative 'test_queries'
require_relative 'test_reacter'
require_relative 'test_reporter'
require_relative 'test_utils'
16 changes: 16 additions & 0 deletions test/test_committer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'test/unit'
require_relative '../lib/config'

Dotenv.load('orgbot.env')

class TestCommit < Test::Unit::TestCase
def test_repo
bot = CommitBot.new(ENV['REPO'], 'master', ENV['TOKEN'])
file = 'test.txt'
content = 'cooltest'
message = 'testmessage'
assert_nothing_raised do
bot.commit(file, content, message)
end
end
end
12 changes: 12 additions & 0 deletions test/test_reacter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'test/unit'
require_relative '../lib/config'
require_relative '../lib/utils/reacter'

class TestReacter < Test::Unit::TestCase
def test_react
rep = ReactBot.new(ENV['REPO'], ENV['TOKEN'])
assert_nothing_raised do
rep.randemoji(5)
end
end
end

0 comments on commit 67b00c1

Please sign in to comment.