Skip to content

Commit

Permalink
switch to rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
tardate committed Oct 29, 2011
1 parent a7e9c52 commit bbb13ec
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -42,7 +42,7 @@ pkg
#*.swp

# For redcar:
#.redcar
.redcar

# For rubinius:
#*.rbc
2 changes: 2 additions & 0 deletions .rvmrc
@@ -0,0 +1,2 @@
rvm use 1.9.2-p136@rgovdata --create

12 changes: 6 additions & 6 deletions Gemfile
@@ -1,13 +1,13 @@
source "http://rubygems.org"
# Add dependencies required to use your gem here.
# Example:
# gem "activesupport", ">= 2.3.5"
gem "rake", '~> 0.9.2.2'

# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem "shoulda", ">= 0"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.6.4"
gem "rcov", ">= 0"
gem 'rdoc', '~> 3.11'
end

group :development, :test do
gem 'rspec', '~> 2.7.0', :require => 'spec'
end
33 changes: 33 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,33 @@
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.3)
git (1.2.5)
jeweler (1.6.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
json (1.6.1)
rake (0.9.2.2)
rcov (0.9.11)
rdoc (3.11)
json (~> 1.4)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.0.0)
jeweler (~> 1.6.4)
rake (~> 0.9.2.2)
rcov
rdoc (~> 3.11)
rspec (~> 2.7.0)
37 changes: 16 additions & 21 deletions Rakefile
Expand Up @@ -10,11 +10,17 @@ rescue Bundler::BundlerError => e
exit e.status_code
end
require 'rake'
require 'rspec'
require 'rspec/core/rake_task'

$LOAD_PATH.unshift('lib')
require 'rgovdata/version'

require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "rgovdata"
gem.version = Rgovdata::Version::STRING
gem.homepage = "http://github.com/tardate/rgovdata"
gem.license = "MIT"
gem.summary = %Q{TODO: one-line summary of your gem}
Expand All @@ -25,29 +31,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
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 do |t|
t.rspec_opts = ["-c", "-f progress"]
t.pattern = 'spec/**/*_spec.rb'
end

task :default => :test

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
task :default => :spec

require 'rdoc/task'
RDoc::Task.new do |rdoc|
rdoc.main = "README.rdoc"
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "rgovdata #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.title = "rgovdata #{Rgovdata::Version::STRING}"
rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb")
end

1 change: 0 additions & 1 deletion VERSION

This file was deleted.

1 change: 1 addition & 0 deletions lib/rgovdata.rb
@@ -0,0 +1 @@
require 'rgovdata/version'
9 changes: 9 additions & 0 deletions lib/rgovdata/version.rb
@@ -0,0 +1,9 @@
class Rgovdata
module Version
MAJOR = 0
MINOR = 1
PATCH = 0

STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
end
24 changes: 24 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,24 @@

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"

# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
# config.use_transactional_fixtures = true

end
18 changes: 0 additions & 18 deletions test/helper.rb

This file was deleted.

7 changes: 0 additions & 7 deletions test/test_rgovdata.rb

This file was deleted.

0 comments on commit bbb13ec

Please sign in to comment.