Permalink
Browse files

added rspec

  • Loading branch information...
1 parent 78b8397 commit af8897fb893d05697043cc3113c8980f6201f1e7 @greshny committed Jan 27, 2012
Showing with 46 additions and 13 deletions.
  1. +2 −0 Gemfile
  2. +17 −0 Gemfile.lock
  3. +8 −13 Rakefile
  4. +7 −0 spec/hamster-exporter_spec.rb
  5. +12 −0 spec/spec_helper.rb
View
@@ -14,6 +14,8 @@ gem "mixlib-cli"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
+ gem "rspec"
+ gem "factory_girl"
gem "shoulda", ">= 0"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.6.4"
View
@@ -1,8 +1,14 @@
GEM
remote: http://rubygems.org/
specs:
+ activesupport (3.2.1)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
addressable (2.2.6)
configuration (1.3.1)
+ diff-lcs (1.1.3)
+ factory_girl (2.5.0)
+ activesupport
faraday (0.7.5)
addressable (~> 2.2.6)
multipart-post (~> 1.1.3)
@@ -12,6 +18,7 @@ GEM
nokogiri (>= 1.4.3.1)
oauth (>= 0.3.6)
oauth2 (>= 0.5.0)
+ i18n (0.6.0)
jeweler (1.6.4)
bundler (~> 1.0)
git (>= 1.2.5)
@@ -32,6 +39,14 @@ GEM
rake (0.9.2.2)
rcov (0.9.11)
rdoc (2.5.8)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
rubyzip (0.9.5)
sequel (3.31.0)
shoulda (2.11.3)
@@ -43,13 +58,15 @@ PLATFORMS
DEPENDENCIES
bundler (~> 1.0.0)
configuration (~> 1.3.1)
+ factory_girl
google-spreadsheet-ruby
jeweler (~> 1.6.4)
mixlib-cli
odf-report
progress
rcov
rdoc
+ rspec
sequel
shoulda
term-ansicolor
View
@@ -27,23 +27,18 @@ Jeweler::Tasks.new do |gem|
end
Jeweler::RubygemsDotOrgTasks.new
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
+require 'rspec/core'
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = FileList['spec/**/*_spec.rb']
end
-require 'rcov/rcovtask'
-Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- test.rcov_opts << '--exclude "gems/*"'
+RSpec::Core::RakeTask.new(:rcov) do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
end
-task :default => :test
-
+task :default => :spec
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
@@ -0,0 +1,7 @@
+require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+
+describe "HamsterExporter" do
+ it "fails" do
+ fail "hey buddy, you should probably rename this file and start specing for real"
+ end
+end
View
@@ -0,0 +1,12 @@
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'rspec'
+require 'hamster-exporter'
+
+# Requires supporting files with custom matchers and macros, etc,
+# in ./support/ and its subdirectories.
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+
+RSpec.configure do |config|
+
+end

0 comments on commit af8897f

Please sign in to comment.