File rubygem-webmock.spec of Package rubygem-webmock

# Generated from webmock-1.7.6.gem by gem2rpm -*- rpm-spec -*-
%global gem_name webmock

Name: rubygem-%{gem_name}
Version: 2.3.2
Release: 1%{?dist}
Summary: Library for stubbing HTTP requests in Ruby
Group: Development/Languages
License: MIT
URL: http://github.com/bblimke/webmock
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Disable some tests requiring network connection.
# https://github.com/bblimke/webmock/pull/682
Patch0: webmock-2.3.2-Some-tests-require-network-connectivity.patch
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(addressable)
BuildRequires: rubygem(crack)
BuildRequires: rubygem(curb)
BuildRequires: rubygem(excon)
BuildRequires: rubygem(hashdiff)
BuildRequires: rubygem(httpclient)
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(rack)
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(test-unit)
BuildRequires: rubygem(typhoeus)
BuildArch: noarch

%description
WebMock allows stubbing HTTP requests and setting expectations on HTTP
requests.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
%setup -q -c -T
%gem_install -n %{SOURCE0}

pushd .%{gem_instdir}
%patch0 -p1
popd

%build

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

sed -i s-/usr/bin/env\ rake-/usr/bin/rake- %{buildroot}%{gem_instdir}/Rakefile



# Run the test suite
%check
pushd .%{gem_instdir}
ruby -e 'Dir.glob "./minitest/**/*.rb", &method(:require)'
ruby -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'

# rubygem-{patron,em-http-request,http} are not in Fedora yet.
sed -i '/patron/ s/^/#/' spec/spec_helper.rb
sed -i '/em-http/ s/^/#/' spec/spec_helper.rb

# and we don't care about code quality, that's upstream business.
rspec spec --exclude-pattern 'spec/{quality_spec.rb,acceptance/{patron,http_rb,em_http_request}/*}'

popd

%files
%dir %{gem_instdir}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/LICENSE
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/minitest
%{gem_instdir}/spec
%{gem_instdir}/test
%{gem_instdir}/webmock.gemspec