test/test_sources.rb in pdd-0.17.2 vs test/test_sources.rb in pdd-0.17.3
- old
+ new
@@ -19,14 +19,16 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
require 'minitest/autorun'
-require 'pdd/sources'
require 'fileutils'
require 'tmpdir'
+require 'pdd/sources'
+require_relative '../test/test__helper'
+
# Sources test.
# Author:: Yegor Bugayenko (yegor@teamed.io)
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
# License:: MIT
class TestSources < Minitest::Test
@@ -36,12 +38,19 @@
assert_equal 2, list.size
end
end
def test_ignores_binary_files
- skip
- in_temp(['c']) do |dir|
- FileUtils.cp(File.join(Dir.pwd, '.git/index'), dir)
+ in_temp([]) do |dir|
+ [
+ 'README.md',
+ '.git/index',
+ 'test_assets/elegant-objects.png',
+ 'test_assets/aladdin.jpg',
+ 'test_assets/article.pdf',
+ 'test_assets/cambria.woff',
+ 'test_assets/favicon.ico'
+ ].each { |f| FileUtils.cp(File.join(Dir.pwd, f), dir) }
list = PDD::Sources.new(dir).fetch
assert_equal 1, list.size
end
end