diff --git a/fakefs-0.13.1.gem b/fakefs-0.13.1.gem new file mode 100644 index 0000000..3c2ea68 Binary files /dev/null and b/fakefs-0.13.1.gem differ diff --git a/fakefs-0.13.1.tar.gz b/fakefs-0.13.1.tar.gz new file mode 100644 index 0000000..52d83eb Binary files /dev/null and b/fakefs-0.13.1.tar.gz differ diff --git a/rubygem-fakefs-0.13.1-Skip-tests-of-pwrite-and-pwrite.patch b/rubygem-fakefs-0.13.1-Skip-tests-of-pwrite-and-pwrite.patch new file mode 100644 index 0000000..e24994c --- /dev/null +++ b/rubygem-fakefs-0.13.1-Skip-tests-of-pwrite-and-pwrite.patch @@ -0,0 +1,12 @@ +diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb +index 35f454c..ff7c827 100644 +--- a/test/fakefs_test.rb ++++ b/test/fakefs_test.rb +@@ -1405,6 +1405,7 @@ class FakeFSTest < Minitest::Test + end + + (RealFile.instance_methods - omitted_file_methods).each do |method_name| ++ next if [:pwrite, :pread].include? method_name + define_method("test_#{method_name}_method_in_file_is_in_fake_fs_file") do + assert File.instance_methods.include?(method_name), "#{method_name} method is not available in File :(" + end diff --git a/rubygem-fakefs.spec b/rubygem-fakefs.spec new file mode 100644 index 0000000..bdd7be5 --- /dev/null +++ b/rubygem-fakefs.spec @@ -0,0 +1,63 @@ +%global gem_name fakefs + +Name: rubygem-%{gem_name} +Version: 0.13.1 +Release: 1 +Summary: A fake filesystem. Use it in your tests +License: MIT +URL: https://github.com/fakefs/fakefs +Source0: https://rubygems.org/gems/fakefs-%{version}.gem +Source1: https://github.com/fakefs/fakefs/archive/v%{version}/fakefs-%{version}.tar.gz +# Skip test of methods introduced in Ruby 2.5. +# https://github.com/fakefs/fakefs/issues/390 +Patch0: rubygem-fakefs-0.13.1-Skip-tests-of-pwrite-and-pwrite.patch + +BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec) rubygem(minitest) +BuildArch: noarch + +%description +A fake filesystem. Use it in your tests. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +%description doc +Documentation for %{name}. + +%prep +%setup -q -n %{gem_name}-%{version} -b 1 +%patch0 -p1 + +%build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +ln -s %{_builddir}/{spec,test} . +rspec spec +popd +sed -i '/bundler/ s/^/#/' test/test_helper.rb +sed -i '/minitest\/rg/ s/^/#/' test/test_helper.rb +ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' + +%files +%dir %{gem_instdir} +%license %{gem_instdir}/LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/README.md + +%changelog +* Thu Jul 30 2020 maminjie - 0.13.1-1 +- package init diff --git a/rubygem-fakefs.yaml b/rubygem-fakefs.yaml new file mode 100644 index 0000000..7f4065f --- /dev/null +++ b/rubygem-fakefs.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: fakefs/fakefs +tag_prefix: "^v" +seperator: "."