Permalink
Browse files

Make tests Ruby 1.9 compliant.

  • Loading branch information...
1 parent 2680c49 commit 1b26716c4e49e3a8d16b96b3014d4e4ddffde2e6 @fnando committed Jun 18, 2012
Showing with 78 additions and 116 deletions.
  1. +2 −0 Gemfile
  2. +54 −0 Gemfile.lock
  3. +1 −41 Rakefile
  4. +19 −75 password_strength.gemspec
  5. +1 −0 test/active_record_test.rb
  6. +1 −0 test/password_strength_test.rb
View
@@ -0,0 +1,2 @@
+source :rubygems
+gemspec
View
@@ -0,0 +1,54 @@
+PATH
+ remote: .
+ specs:
+ password_strength (0.3.2)
+ activerecord
+ activesupport
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activemodel (3.2.5)
+ activesupport (= 3.2.5)
+ builder (~> 3.0.0)
+ activerecord (3.2.5)
+ activemodel (= 3.2.5)
+ activesupport (= 3.2.5)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activesupport (3.2.5)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.0)
+ coderay (1.0.6)
+ diff-lcs (1.1.3)
+ i18n (0.6.0)
+ method_source (0.7.1)
+ multi_json (1.3.6)
+ pry (0.9.9.6)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7.1)
+ slop (>= 2.4.4, < 3)
+ rake (0.9.2.2)
+ rspec (2.10.0)
+ rspec-core (~> 2.10.0)
+ rspec-expectations (~> 2.10.0)
+ rspec-mocks (~> 2.10.0)
+ rspec-core (2.10.1)
+ rspec-expectations (2.10.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.10.1)
+ slop (2.4.4)
+ sqlite3 (1.3.6)
+ tzinfo (0.3.33)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ password_strength!
+ pry
+ rake
+ rspec
+ sqlite3
View
@@ -1,17 +1,7 @@
-require "rcov/rcovtask"
require "rake/testtask"
-require "rake/rdoctask"
+require "rdoc/task"
require "lib/password_strength/version"
-Rcov::RcovTask.new do |t|
- t.test_files = FileList["test/**/*_test.rb"]
- t.rcov_opts = ["--sort coverage", "--exclude .renv,.bundle,helper,errors.rb"]
-
- t.output_dir = "coverage"
- t.libs << "test"
- t.verbose = true
-end
-
Rake::TestTask.new do |t|
t.libs += %w[test lib]
t.ruby_opts = %w[-rubygems]
@@ -27,33 +17,3 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include("README.rdoc", "CHANGELOG.rdoc")
rdoc.rdoc_files.include("lib/**/*.rb")
end
-
-begin
- require "jeweler"
-
- JEWEL = Jeweler::Tasks.new do |gem|
- gem.name = "password_strength"
- gem.email = "fnando.vieira@gmail.com"
- gem.homepage = "http://github.com/fnando/password_strength"
- gem.authors = ["Nando Vieira"]
- gem.version = PasswordStrength::Version::STRING
- gem.summary = "Check password strength against several rules. Includes ActiveRecord support."
- gem.description = <<-TXT
-Validates the strength of a password according to several rules:
-
-* size
-* 3+ numbers
-* 2+ special characters
-* uppercased and downcased letters
-* combination of numbers, letters and symbols
-* password contains username
-* sequences (123, abc, aaa)
- TXT
- gem.files = FileList["{README,CHANGELOG}.rdoc", "{lib,test,javascripts,locales}/**/*"]
- gem.add_dependency "activesupport", ">= 2.3.5"
- end
-
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "[JEWELER] You need to install Jeweler - `gem install jeweler` - to build this gem"
-end
View
@@ -1,82 +1,26 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "password_strength/version"
Gem::Specification.new do |s|
- s.name = %q{password_strength}
- s.version = "0.3.2"
+ s.name = "password_strength"
+ s.version = PasswordStrength::Version::STRING
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Nando Vieira"]
+ s.email = ["fnando.vieira@gmail.com"]
+ s.homepage = "http://github.com/fnando/password_strength"
+ s.summary = "Check password strength against several rules. Includes ActiveRecord support."
+ s.description = s.summary
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Nando Vieira"]
- s.date = %q{2010-09-17}
- s.description = %q{Validates the strength of a password according to several rules:
-
-* size
-* 3+ numbers
-* 2+ special characters
-* uppercased and downcased letters
-* combination of numbers, letters and symbols
-* password contains username
-* sequences (123, abc, aaa)
-}
- s.email = %q{fnando.vieira@gmail.com}
- s.extra_rdoc_files = [
- "README.rdoc"
- ]
- s.files = [
- "CHANGELOG.rdoc",
- "README.rdoc",
- "javascripts/jquery.strength.js",
- "javascripts/password_strength.js",
- "lib/password_strength.rb",
- "lib/password_strength/active_record.rb",
- "lib/password_strength/active_record/ar2.rb",
- "lib/password_strength/active_record/ar3.rb",
- "lib/password_strength/base.rb",
- "lib/password_strength/validators/windows2008.rb",
- "lib/password_strength/version.rb",
- "locales/en.yml",
- "locales/pt.yml",
- "test/active_record_test.rb",
- "test/jquery-1.4.2.js",
- "test/jquery_strength_test.html",
- "test/jquery_strength_test.js",
- "test/jsunittest/jsunittest.js",
- "test/jsunittest/unittest.css",
- "test/password_strength_test.html",
- "test/password_strength_test.js",
- "test/password_strength_test.rb",
- "test/schema.rb",
- "test/test_helper.rb",
- "test/user.rb",
- "test/validators/windows2008_test.rb"
- ]
- s.homepage = %q{http://github.com/fnando/password_strength}
- s.rdoc_options = ["--charset=UTF-8"]
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{Check password strength against several rules. Includes ActiveRecord support.}
- s.test_files = [
- "test/active_record_test.rb",
- "test/password_strength_test.rb",
- "test/schema.rb",
- "test/test_helper.rb",
- "test/user.rb",
- "test/validators/windows2008_test.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<activesupport>, [">= 2.3.5"])
- else
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
- end
- else
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
- end
+ s.add_dependency "activesupport"
+ s.add_dependency "activerecord"
+ s.add_development_dependency "sqlite3"
+ s.add_development_dependency "rake"
+ s.add_development_dependency "rspec"
+ s.add_development_dependency "pry"
end
-
@@ -1,3 +1,4 @@
+# -*- encoding: utf-8 -*-
require "test_helper"
class TestActiveRecord < Test::Unit::TestCase
@@ -1,3 +1,4 @@
+# -*- encoding: utf-8 -*-
require "test_helper"
class TestPasswordStrength < Test::Unit::TestCase

0 comments on commit 1b26716

Please sign in to comment.