fileutils2 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ require 'fileutils2'
2
+ require 'test/unit'
3
+
4
+ class TestFileUtils2Inclusion < Test::Unit::TestCase
5
+
6
+ module Foo
7
+ def foo?; true; end
8
+ end
9
+
10
+ def test_include_into_all_submodules
11
+ ::FileUtils2.send(:include, Foo)
12
+
13
+ assert_includes ::FileUtils2.ancestors, Foo
14
+ assert_includes ::FileUtils2::NoWrite.ancestors, Foo
15
+ assert_includes ::FileUtils2::Verbose.ancestors, Foo
16
+ assert_includes ::FileUtils2::DryRun.ancestors, Foo
17
+
18
+ assert ::FileUtils2::NoWrite.foo?
19
+ assert ::FileUtils2::Verbose.foo?
20
+ assert ::FileUtils2::DryRun.foo?
21
+ assert ::FileUtils2.foo?
22
+ end
23
+
24
+ end
@@ -0,0 +1,19 @@
1
+ # $Id$
2
+
3
+ require 'fileutils2'
4
+ require 'fileutils2/visibility_tests'
5
+ require 'fileutils2/clobber'
6
+ require 'test/unit'
7
+
8
+ class TestFileUtils2NoWrite < Test::Unit::TestCase
9
+
10
+ include FileUtils2::NoWrite
11
+ include TestFileUtils2::Visibility
12
+ include TestFileUtils2::Clobber
13
+
14
+ def setup
15
+ super
16
+ @fu_module = FileUtils2::NoWrite
17
+ end
18
+
19
+ end
@@ -0,0 +1,17 @@
1
+ # $Id$
2
+
3
+ require 'fileutils2'
4
+ require 'fileutils2/visibility_tests'
5
+ require 'test/unit'
6
+
7
+ class TestFileUtils2Verbose < Test::Unit::TestCase
8
+
9
+ include FileUtils2::Verbose
10
+ include TestFileUtils2::Visibility
11
+
12
+ def setup
13
+ super
14
+ @fu_module = FileUtils2::Verbose
15
+ end
16
+
17
+ end
@@ -0,0 +1,41 @@
1
+ require 'fileutils2'
2
+ require 'test/unit'
3
+
4
+ class TestFileUtils2 < Test::Unit::TestCase
5
+ end
6
+
7
+ ##
8
+ # These tests are reused in the FileUtils::Verbose, FileUtils::NoWrite and
9
+ # FileUtils::DryRun tests
10
+ #
11
+ module TestFileUtils2::Visibility
12
+
13
+ FileUtils2::METHODS.each do |m|
14
+ define_method "test_singleton_visibility_#{m}" do
15
+ assert @fu_module.respond_to?(m, true),
16
+ "#{@fu_module}.#{m} is not defined"
17
+ assert @fu_module.respond_to?(m, false),
18
+ "#{@fu_module}.#{m} is not public"
19
+ end
20
+
21
+ define_method "test_visibility_#{m}" do
22
+ assert respond_to?(m, true),
23
+ "#{@fu_module}\##{m} is not defined"
24
+ assert @fu_module.private_method_defined?(m),
25
+ "#{@fu_module}\##{m} is not private"
26
+ end
27
+ end
28
+
29
+ FileUtils2::StreamUtils_.private_instance_methods.each do |m|
30
+ define_method "test_singleton_visibility_#{m}" do
31
+ assert @fu_module.respond_to?(m, true),
32
+ "#{@fu_module}\##{m} is not defined"
33
+ end
34
+
35
+ define_method "test_visibility_#{m}" do
36
+ assert respond_to?(m, true),
37
+ "#{@fu_module}\##{m} is not defined"
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,16 @@
1
+ if defined?(::FileUtils)
2
+ warn "WARNING! Original FileUtils library is already loaded!"
3
+ end
4
+
5
+ root = File.expand_path('..', File.dirname(__FILE__))
6
+
7
+ $LOAD_PATH.unshift(File.join(root, 'test'))
8
+ $LOAD_PATH.unshift(File.join(root, 'lib'))
9
+
10
+ require 'minitest/autorun'
11
+
12
+ test_files = Dir[File.join(root, 'test', 'fileutils2', 'test_*.rb')]
13
+ test_files.each do |test_file|
14
+ require test_file
15
+ end
16
+
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fileutils2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Trans
9
+ - Minero Aoki
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-03-19 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: minitest
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: ergo
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ type: :development
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description: FileUtils2 is an improved design of Ruby's built-in FileUtils library.
48
+ email:
49
+ - transfire@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files:
53
+ - LICENSE.txt
54
+ - HISTORY.md
55
+ - README.md
56
+ files:
57
+ - .index
58
+ - lib/fileutils2.rb
59
+ - lib/fileutils2/override.rb
60
+ - test/runner.rb
61
+ - test/fileutils2/test_verbose.rb
62
+ - test/fileutils2/test_nowrite.rb
63
+ - test/fileutils2/test_inclusion.rb
64
+ - test/fileutils2/test_fileutils.rb
65
+ - test/fileutils2/clobber.rb
66
+ - test/fileutils2/visibility_tests.rb
67
+ - test/fileutils2/fileasserts.rb
68
+ - test/fileutils2/test_dryrun.rb
69
+ - LICENSE.txt
70
+ - HISTORY.md
71
+ - README.md
72
+ homepage: http://rubyworks.github.com/fileutils2
73
+ licenses:
74
+ - BSD-2-Clause
75
+ - Ruby
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 1.8.24
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: FileUtils refactored
98
+ test_files:
99
+ - test/runner.rb
100
+ - test/fileutils2/test_verbose.rb
101
+ - test/fileutils2/test_nowrite.rb
102
+ - test/fileutils2/test_inclusion.rb
103
+ - test/fileutils2/test_fileutils.rb
104
+ - test/fileutils2/clobber.rb
105
+ - test/fileutils2/visibility_tests.rb
106
+ - test/fileutils2/fileasserts.rb
107
+ - test/fileutils2/test_dryrun.rb
108
+ has_rdoc: