summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2015-01-27 01:24:11 -0800
committerRyan Davis <ryand@zenspider.com>2015-01-27 01:24:11 -0800
commit3c6bdcdbe46426545334762d0b1cd0c6ecb6ecf1 (patch)
treeb71cae0a123ece9a3c4c937a70e2ffc3858c3a1b /test
parentf01396e8c70c70933b1b24d4e387a40a3daed6b0 (diff)
downloadhoe-3c6bdcdbe46426545334762d0b1cd0c6ecb6ecf1.tar.gz
converted everything to double quoted strings
[git-p4: depot-paths = "//src/hoe/dev/": change = 9954]
Diffstat (limited to 'test')
-rw-r--r--test/test_hoe.rb142
-rw-r--r--test/test_hoe_debug.rb30
-rw-r--r--test/test_hoe_gemcutter.rb2
-rw-r--r--test/test_hoe_publish.rb14
-rw-r--r--test/test_hoe_test.rb4
5 files changed, 96 insertions, 96 deletions
diff --git a/test/test_hoe.rb b/test/test_hoe.rb
index c9ff430..bc0c2fc 100644
--- a/test/test_hoe.rb
+++ b/test/test_hoe.rb
@@ -1,6 +1,6 @@
-require 'minitest/autorun'
-require 'hoe'
-require 'tempfile'
+require "minitest/autorun"
+require "hoe"
+require "tempfile"
class Hoe
def self.files= x
@@ -59,22 +59,22 @@ class TestHoe < Minitest::Test
def test_activate_plugins
initializers = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
- assert_includes initializers, 'initialize_package'
- assert_includes initializers, 'initialize_publish'
- assert_includes initializers, 'initialize_test'
+ assert_includes initializers, "initialize_package"
+ assert_includes initializers, "initialize_publish"
+ assert_includes initializers, "initialize_test"
end
def test_activate_plugins_hoerc
- home = ENV['HOME']
+ home = ENV["HOME"]
load_path = $LOAD_PATH.dup
Hoe.files = nil
Dir.mktmpdir do |path|
- ENV['HOME'] = path
+ ENV["HOME"] = path
$LOAD_PATH << path
- Dir.mkdir File.join(path, 'hoe')
- open File.join(path, 'hoe', 'hoerc.rb'), 'w' do |io|
+ Dir.mkdir File.join(path, "hoe")
+ open File.join(path, "hoe", "hoerc.rb"), "w" do |io|
io.write <<-EOM
module Hoe::Hoerc
def initialize_hoerc; end
@@ -83,11 +83,11 @@ class TestHoe < Minitest::Test
EOM
end
- write_hoerc path, 'plugins' => %w[hoerc]
+ write_hoerc path, "plugins" => %w[hoerc]
methods = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
- assert_includes methods, 'initialize_hoerc'
+ assert_includes methods, "initialize_hoerc"
assert_includes Hoe.plugins, :hoerc
end
ensure
@@ -95,21 +95,21 @@ class TestHoe < Minitest::Test
end
def test_have_gem_eh
- assert hoe.have_gem? 'rake'
- refute hoe.have_gem? 'nonexistent'
+ assert hoe.have_gem? "rake"
+ refute hoe.have_gem? "nonexistent"
end
def test_initialize_plugins_hoerc
- home = ENV['HOME']
+ home = ENV["HOME"]
load_path = $LOAD_PATH.dup
Hoe.files = nil
Dir.mktmpdir do |path|
- ENV['HOME'] = path
+ ENV["HOME"] = path
$LOAD_PATH << path
- Dir.mkdir File.join(path, 'hoe')
- open File.join(path, 'hoe', 'hoerc.rb'), 'w' do |io|
+ Dir.mkdir File.join(path, "hoe")
+ open File.join(path, "hoe", "hoerc.rb"), "w" do |io|
io.write <<-EOM
module Hoe::Hoerc
def initialize_hoerc; @hoerc_plugin_initialized = true; end
@@ -118,10 +118,10 @@ class TestHoe < Minitest::Test
EOM
end
- write_hoerc path, 'plugins' => %w[hoerc]
+ write_hoerc path, "plugins" => %w[hoerc]
methods = hoe.instance_variables.map(&:to_s)
- assert_includes(methods, '@hoerc_plugin_initialized',
+ assert_includes(methods, "@hoerc_plugin_initialized",
"Hoerc plugin wasn't initialized")
assert_includes Hoe.plugins, :hoerc
end
@@ -130,7 +130,7 @@ class TestHoe < Minitest::Test
end
def write_hoerc path, data
- open File.join(path, '.hoerc'), 'w' do |io|
+ open File.join(path, ".hoerc"), "w" do |io|
io.write YAML.dump data
end
end
@@ -140,23 +140,23 @@ class TestHoe < Minitest::Test
Hoe.plugins.delete :hoerc
Hoe.send :remove_const, :Hoerc
$LOAD_PATH.replace load_path
- ENV['HOME'] = home
+ ENV["HOME"] = home
end
def test_initialize_intuit
Dir.mktmpdir do |path|
Dir.chdir path do
- open 'Manifest.txt', 'w' do |io| # sorted
- io.puts 'FAQ.rdoc'
- io.puts 'History.rdoc'
- io.puts 'README.rdoc'
+ open "Manifest.txt", "w" do |io| # sorted
+ io.puts "FAQ.rdoc"
+ io.puts "History.rdoc"
+ io.puts "README.rdoc"
end
- open 'README.rdoc', 'w' do |io| io.puts '= blah' end
- open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
+ open "README.rdoc", "w" do |io| io.puts "= blah" end
+ open "History.rdoc", "w" do |io| io.puts "=== 1.0" end
- assert_equal 'History.rdoc', hoe.history_file
- assert_equal 'README.rdoc', hoe.readme_file
+ assert_equal "History.rdoc", hoe.history_file
+ assert_equal "README.rdoc", hoe.readme_file
assert_equal %w[FAQ.rdoc History.rdoc README.rdoc],
hoe.spec.extra_rdoc_files
end
@@ -166,28 +166,28 @@ class TestHoe < Minitest::Test
def test_initialize_intuit_ambiguous
Dir.mktmpdir do |path|
Dir.chdir path do
- open 'Manifest.txt', 'w' do |io|
- io.puts 'History.rdoc' # sorted
- io.puts 'README.ja.rdoc'
- io.puts 'README.rdoc'
+ open "Manifest.txt", "w" do |io|
+ io.puts "History.rdoc" # sorted
+ io.puts "README.ja.rdoc"
+ io.puts "README.rdoc"
end
- open 'README.rdoc', 'w' do |io| io.puts '= blah' end
- open 'README.ja.rdoc', 'w' do |io| io.puts '= blah' end
- open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
+ open "README.rdoc", "w" do |io| io.puts "= blah" end
+ open "README.ja.rdoc", "w" do |io| io.puts "= blah" end
+ open "History.rdoc", "w" do |io| io.puts "=== 1.0" end
- assert_equal 'README.ja.rdoc', hoe(:skip_files).readme_file
+ assert_equal "README.ja.rdoc", hoe(:skip_files).readme_file
end
end
end
def test_file_read_utf
- Tempfile.open 'BOM' do |io|
+ Tempfile.open "BOM" do |io|
io.write "\xEF\xBB\xBFBOM"
io.rewind
content = File.read_utf io.path
- assert_equal 'BOM', content
+ assert_equal "BOM", content
if content.respond_to? :encoding then
assert_equal Encoding::UTF_8, content.encoding
@@ -231,7 +231,7 @@ class TestHoe < Minitest::Test
t = Gem::Specification::TODAY
hoe = self.hoe do
- self.version = '1.2.3'
+ self.version = "1.2.3"
end
files = File.read("Manifest.txt").split(/\n/) + [".gemtest"]
@@ -251,20 +251,20 @@ class TestHoe < Minitest::Test
text_files = files.grep(/(txt|rdoc)$/).reject { |f| f =~ /template/ }
- assert_equal 'blah', spec.name
- assert_equal '1.2.3', spec.version.to_s
- assert_equal '>= 0', spec.required_rubygems_version.to_s
+ assert_equal "blah", spec.name
+ assert_equal "1.2.3", spec.version.to_s
+ assert_equal ">= 0", spec.required_rubygems_version.to_s
- assert_equal ['author'], spec.authors
+ assert_equal ["author"], spec.authors
assert_equal t, spec.date
assert_match(/Hoe.*Rakefiles/, spec.description)
- assert_equal ['email'], spec.email
- assert_equal ['sow'], spec.executables
+ assert_equal ["email"], spec.email
+ assert_equal ["sow"], spec.executables
assert_equal text_files, spec.extra_rdoc_files
assert_equal files.sort, spec.files.sort
assert_equal urls["home"], spec.homepage
- assert_equal ['--main', 'README.rdoc'], spec.rdoc_options
- assert_equal ['lib'], spec.require_paths
+ assert_equal ["--main", "README.rdoc"], spec.rdoc_options
+ assert_equal ["lib"], spec.require_paths
assert_equal Gem::RubyGemsVersion, spec.rubygems_version
assert_match(/^Hoe.*Rakefiles$/, spec.summary)
@@ -297,8 +297,8 @@ class TestHoe < Minitest::Test
def test_multiple_calls_to_license
hoe = self.hoe :skip_license do
- license 'MIT'
- license 'GPL-2'
+ license "MIT"
+ license "GPL-2"
end
spec = hoe.spec
@@ -308,7 +308,7 @@ class TestHoe < Minitest::Test
def test_setting_licenses
hoe = self.hoe :skip_license do
- self.licenses = ['MIT', 'GPL-2']
+ self.licenses = ["MIT", "GPL-2"]
end
spec = hoe.spec
@@ -327,7 +327,7 @@ class TestHoe < Minitest::Test
end
def test_read_manifest
- expected = File.read_utf('Manifest.txt').split
+ expected = File.read_utf("Manifest.txt").split
assert_equal expected, hoe.read_manifest
end
@@ -335,12 +335,12 @@ class TestHoe < Minitest::Test
def test_rename
# project, file_name, klass, test_klass = Hoe.normalize_names 'project_name'
- assert_equal %w( word word Word TestWord), Hoe.normalize_names('word')
- assert_equal %w( word word Word TestWord), Hoe.normalize_names('Word')
- assert_equal %w(two_words two_words TwoWords TestTwoWords), Hoe.normalize_names('TwoWords')
- assert_equal %w(two_words two_words TwoWords TestTwoWords), Hoe.normalize_names('twoWords')
- assert_equal %w(two-words two/words Two::Words TestTwo::TestWords), Hoe.normalize_names('two-words')
- assert_equal %w(two_words two_words TwoWords TestTwoWords), Hoe.normalize_names('two_words')
+ assert_equal %w( word word Word TestWord), Hoe.normalize_names("word")
+ assert_equal %w( word word Word TestWord), Hoe.normalize_names("Word")
+ assert_equal %w(two_words two_words TwoWords TestTwoWords), Hoe.normalize_names("TwoWords")
+ assert_equal %w(two_words two_words TwoWords TestTwoWords), Hoe.normalize_names("twoWords")
+ assert_equal %w(two-words two/words Two::Words TestTwo::TestWords), Hoe.normalize_names("two-words")
+ assert_equal %w(two_words two_words TwoWords TestTwoWords), Hoe.normalize_names("two_words")
end
def test_nosudo
@@ -350,40 +350,40 @@ class TestHoe < Minitest::Test
end
end
- assert_match(/^(sudo )?(j|maglev-)?gem.*/, hoe.install_gem('foo'))
- ENV['NOSUDO'] = '1'
- assert_match(/^(j|maglev-)?gem.*/, hoe.install_gem('foo'))
+ assert_match(/^(sudo )?(j|maglev-)?gem.*/, hoe.install_gem("foo"))
+ ENV["NOSUDO"] = "1"
+ assert_match(/^(j|maglev-)?gem.*/, hoe.install_gem("foo"))
ensure
ENV.delete "NOSUDO"
end
def test_with_config_default
- home = ENV['HOME']
+ home = ENV["HOME"]
Hoe.files = nil
Dir.mktmpdir do |path|
- ENV['HOME'] = path
+ ENV["HOME"] = path
hoeconfig = hoe.with_config {|config, _| config }
assert_equal Hoe::DEFAULT_CONFIG, hoeconfig
end
ensure
- ENV['HOME'] = home
+ ENV["HOME"] = home
end
def test_with_config_overrides
overrides = {
- 'exclude' => Regexp.union( Hoe::DEFAULT_CONFIG["exclude"], /\.hg/ ),
- 'plugins' => ['tweedledee', 'tweedledum']
+ "exclude" => Regexp.union( Hoe::DEFAULT_CONFIG["exclude"], /\.hg/ ),
+ "plugins" => ["tweedledee", "tweedledum"]
}
- overrides_rcfile = File.join(Dir.pwd, '.hoerc')
+ overrides_rcfile = File.join(Dir.pwd, ".hoerc")
- home = ENV['HOME']
+ home = ENV["HOME"]
Hoe.files = nil
Dir.mktmpdir do |path|
- ENV['HOME'] = path
+ ENV["HOME"] = path
write_hoerc path, Hoe::DEFAULT_CONFIG
@@ -397,6 +397,6 @@ class TestHoe < Minitest::Test
end
ensure
File.delete overrides_rcfile if File.exist?( overrides_rcfile )
- ENV['HOME'] = home
+ ENV["HOME"] = home
end
end
diff --git a/test/test_hoe_debug.rb b/test/test_hoe_debug.rb
index 77ca413..e8c7f8d 100644
--- a/test/test_hoe_debug.rb
+++ b/test/test_hoe_debug.rb
@@ -1,8 +1,8 @@
-require 'hoe'
-require File.expand_path 'lib/hoe/debug.rb' # ugh. avoid dupe warnings
-require 'tmpdir'
-require 'tempfile'
-require 'minitest/autorun'
+require "hoe"
+require File.expand_path "lib/hoe/debug.rb" # ugh. avoid dupe warnings
+require "tmpdir"
+require "tempfile"
+require "minitest/autorun"
class TestHoeDebug < Minitest::Test
@@ -40,9 +40,9 @@ class TestHoeDebug < Minitest::Test
def test_check_manifest_generated
in_tmpdir do
- manifest 'generated.rb'
+ manifest "generated.rb"
- open 'generated.rb', 'w' do |io| io.puts 'generated = true' end
+ open "generated.rb", "w" do |io| io.puts "generated = true" end
assert_subprocess_silent do
check_manifest
@@ -56,7 +56,7 @@ class TestHoeDebug < Minitest::Test
in_tmpdir do
manifest
- open 'missing.rb', 'w' do |io| io.puts 'missing = true' end
+ open "missing.rb", "w" do |io| io.puts "missing = true" end
e = nil
@@ -86,18 +86,18 @@ class TestHoeDebug < Minitest::Test
end
def manifest extra = nil
- open 'Manifest.txt', 'w' do |io| # sorted
- io.puts 'History.txt'
- io.puts 'Manifest.txt'
- io.puts 'README.txt'
+ open "Manifest.txt", "w" do |io| # sorted
+ io.puts "History.txt"
+ io.puts "Manifest.txt"
+ io.puts "README.txt"
io.puts extra if extra
end
- open 'README.txt', 'w' do |io| io.puts '= blah' end
- open 'History.txt', 'w' do |io| io.puts '=== 1.0' end
+ open "README.txt", "w" do |io| io.puts "= blah" end
+ open "History.txt", "w" do |io| io.puts "=== 1.0" end
end
def with_config
- yield({ 'exclude' => [] }, '~/.hoerc')
+ yield({ "exclude" => [] }, "~/.hoerc")
end
end
diff --git a/test/test_hoe_gemcutter.rb b/test/test_hoe_gemcutter.rb
index 5e70024..82d2b7c 100644
--- a/test/test_hoe_gemcutter.rb
+++ b/test/test_hoe_gemcutter.rb
@@ -8,7 +8,7 @@ class TestHoeGemcutter < Minitest::Test
def test_gemcutter_tasks_defined
define_gemcutter_tasks
assert Rake::Task[:release_to_gemcutter]
- assert Rake::Task[:release_to].prerequisites.include?('release_to_gemcutter')
+ assert Rake::Task[:release_to].prerequisites.include?("release_to_gemcutter")
end
# TODO add tests for push once using Gem::Commands::Push (waiting on rubygems release)
diff --git a/test/test_hoe_publish.rb b/test/test_hoe_publish.rb
index 1d243aa..8dd0137 100644
--- a/test/test_hoe_publish.rb
+++ b/test/test_hoe_publish.rb
@@ -1,14 +1,14 @@
-require 'rubygems'
-require 'minitest/autorun'
-require 'hoe'
+require "rubygems"
+require "minitest/autorun"
+require "hoe"
class TestHoePublish < Minitest::Test
def setup
- @hoe = Hoe.spec 'blah' do
- self.version = '1.0'
+ @hoe = Hoe.spec "blah" do
+ self.version = "1.0"
- developer 'author', ''
- license 'MIT'
+ developer "author", ""
+ license "MIT"
end
end
diff --git a/test/test_hoe_test.rb b/test/test_hoe_test.rb
index 6450d5c..a0bce31 100644
--- a/test/test_hoe_test.rb
+++ b/test/test_hoe_test.rb
@@ -13,13 +13,13 @@ class TestHoeTest < Minitest::Test
initialize_test
def test_globs
- ['test/test_hoe_test.rb']
+ ["test/test_hoe_test.rb"]
end
end
end
def test_make_test_cmd_with_different_testlibs
- skip "Using TESTOPTS... skipping" if ENV['TESTOPTS']
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
expected = ['-w -Ilib:bin:test:. -e \'require "rubygems"; %s',
'require "test/test_hoe_test.rb"',