Skip to content

Commit

Permalink
Adding base for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaberer committed Jul 1, 2013
1 parent 0775665 commit dbb9341
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: ruby
rvm:
- 1.9.2
- 1.9.3
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Cinch::Plugins::SimpleCalc

[![Gem Version](https://badge.fury.io/rb/cinch-simplecalc.png)](http://badge.fury.io/rb/cinch-simplecalc)
[![Dependency Status](https://gemnasium.com/bhaberer/cinch-simplecalc.png)](https://gemnasium.com/bhaberer/cinch-simplecalc)
[![Build Status](https://travis-ci.org/bhaberer/cinch-simplecalc.png?branch=master)](https://travis-ci.org/bhaberer/cinch-simplecalc)
[![Coverage Status](https://coveralls.io/repos/bhaberer/cinch-simplecalc/badge.png?branch=master)](https://coveralls.io/r/bhaberer/cinch-simplecalc?branch=master)
[![Code Climate](https://codeclimate.com/github/bhaberer/cinch-simplecalc.png)](https://codeclimate.com/github/bhaberer/cinch-simplecalc)

Cinch plugin to allow channel users to do basic math

## Installation
Expand Down
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new

task :default => :spec
task :test => :spec
9 changes: 7 additions & 2 deletions cinch-simplecalc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.add_dependency 'calc'
gem.add_dependency 'cinch-cooldown'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'coveralls'

gem.add_dependency 'cinch', '~> 2.0.5'
gem.add_dependency 'cinch-toolbox', '~> 1.0.0'
gem.add_dependency 'cinch-cooldown', '~> 1.0.0'
end
22 changes: 22 additions & 0 deletions spec/cinch-simplecalc_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'spec_helper'

describe Cinch::Plugins::SimpleCalc do

include Cinch::Test

before(:each) do
@bot = make_bot(Cinch::Plugins::SimpleCalc)
end

it 'should allow users to perform simple math' do
msg = make_message(@bot, '!math 2 + 2')
get_replies(msg).
should == '4'
end

it 'should strip all non numeric information from the string' do
msg = make_message(@bot, '!math cos 2')
get_replies(msg).
should == '2'
end
end
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'coveralls'
Coveralls.wear!
require 'cinch-simplecalc'
require 'cinch/test'

0 comments on commit dbb9341

Please sign in to comment.