This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup MiniTest. Let unknown attributes be ignored during initializati…
…on in RunKeeper::Activity
- Loading branch information
Showing
5 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
require 'bundler/gem_tasks' | ||
begin | ||
require 'rubygems' | ||
require 'bundler' | ||
rescue LoadError | ||
raise 'Could not load the bundler gem. Install it with `gem install bundler`.' | ||
end | ||
|
||
begin | ||
Bundler.setup | ||
rescue Bundler::GemNotFound | ||
raise RuntimeError, "Bundler couldn't find some gems." + | ||
"Did you run `bundle install`?" | ||
end | ||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
require 'rake/testtask' | ||
|
||
Rake::TestTask.new(:test) do |test| | ||
test.libs << 'test' | ||
test.pattern = 'test/**/*_test.rb' | ||
end | ||
|
||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'helper' | ||
|
||
class ActivityTest < MiniTest::Unit::TestCase | ||
def test_initailization_ignores_unknown_attributes | ||
refute_match Activity.new(:foo => 'bar').instance_variables, /foo/ | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require 'minitest/autorun' | ||
require 'run_keeper' | ||
|
||
include RunKeeper |