plugin_test_helper 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  == master
2
2
 
3
+ == 0.2.1 / 2008-01-11
4
+
5
+ * Remove init.rb since the library should never be loaded automatically
6
+ * Fix fixtures not being loaded within the test application console [Sergei Kozlov]
7
+
3
8
  == 0.2.0 / 2008-12-14
4
9
 
5
10
  * Remove the PluginAWeek namespace
data/Rakefile CHANGED
@@ -5,11 +5,11 @@ require 'rake/contrib/sshpublisher'
5
5
 
6
6
  spec = Gem::Specification.new do |s|
7
7
  s.name = 'plugin_test_helper'
8
- s.version = '0.2.0'
8
+ s.version = '0.2.1'
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.summary = 'Simplifies plugin testing by creating an isolated Rails environment that simulates its usage in a real application.'
11
11
 
12
- s.files = FileList['{generators,lib,test}/**/*'] + %w(CHANGELOG.rdoc init.rb LICENSE Rakefile README.rdoc) - FileList['generators/plugin_test_structure/templates/app_root/{log,log/*,script,script/*}']
12
+ s.files = FileList['{generators,lib,test}/**/*'] + %w(CHANGELOG.rdoc LICENSE Rakefile README.rdoc) - FileList['generators/plugin_test_structure/templates/app_root/{log,log/*,script,script/*}']
13
13
  s.require_path = 'lib'
14
14
  s.has_rdoc = true
15
15
  s.test_files = Dir['test/**/*_test.rb']
@@ -1,7 +1,7 @@
1
1
  irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
2
2
  libs = " -r irb/completion"
3
3
  libs << " -r test/test_helper"
4
- libs << " -r plugin_test_helper/console_with_fixtures"
5
4
  libs << " -r console_app"
6
5
  libs << " -r console_with_helpers"
6
+ libs << " -r plugin_test_helper/console_with_fixtures"
7
7
  exec "#{irb} #{libs} --simple-prompt"
@@ -0,0 +1,4 @@
1
+ # Loads fixtures into the database when running the test app via the console
2
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, '../fixtures/*.{yml,csv}'))).each do |fixture_file|
3
+ Fixtures.create_fixtures(File.join(Rails.root, '../fixtures'), File.basename(fixture_file, '.*'))
4
+ end
@@ -3,7 +3,7 @@ require 'fileutils'
3
3
 
4
4
  class PluginTestHelperTest < Test::Unit::TestCase
5
5
  def setup
6
- @original_load_path = $LOAD_PATH
6
+ @original_load_path = $LOAD_PATH.dup
7
7
  end
8
8
 
9
9
  def test_should_load_with_no_app_root
@@ -54,6 +54,10 @@ class PluginTestStructureGeneratorTest < Test::Unit::TestCase
54
54
  assert File.exists?("#{Rails.root}/vendor/plugins/acts_as_foo/test/app_root/config/routes.rb")
55
55
  end
56
56
 
57
+ def test_should_create_console_helper
58
+ assert File.exists?("#{Rails.root}/vendor/plugins/acts_as_foo/test/app_root/lib/console_with_fixtures.rb")
59
+ end
60
+
57
61
  def test_should_create_console_script
58
62
  assert File.exists?("#{Rails.root}/vendor/plugins/acts_as_foo/test/app_root/script/console")
59
63
  end
data/test/test_helper.rb CHANGED
@@ -39,8 +39,7 @@ Test::Unit::TestCase.class_eval do
39
39
 
40
40
  # Forget that the environment files were loaded so that a new app environment
41
41
  # can be set up again
42
- $".delete('config/environment.rb')
43
- $".delete('test_help.rb')
42
+ $".delete_if {|path| path =~ /(config\/environment\.rb|test_help\.rb)$/}
44
43
 
45
44
  # Remove the app folder
46
45
  FileUtils.rm_r(Dir['test/app_root/*'])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plugin_test_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Pfeifer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-14 00:00:00 -05:00
12
+ date: 2009-01-11 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -43,6 +43,8 @@ files:
43
43
  - generators/plugin_test_structure/templates
44
44
  - generators/plugin_test_structure/templates/test_helper.rb
45
45
  - generators/plugin_test_structure/templates/app_root
46
+ - generators/plugin_test_structure/templates/app_root/lib
47
+ - generators/plugin_test_structure/templates/app_root/lib/console_with_fixtures.rb
46
48
  - generators/plugin_test_structure/templates/app_root/config
47
49
  - generators/plugin_test_structure/templates/app_root/config/environment.rb
48
50
  - generators/plugin_test_structure/templates/app_root/config/environments
@@ -137,7 +139,6 @@ files:
137
139
  - test/unit/plugin_locator_test.rb
138
140
  - test/app_root
139
141
  - CHANGELOG.rdoc
140
- - init.rb
141
142
  - LICENSE
142
143
  - Rakefile
143
144
  - README.rdoc
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'plugin_test_helper'