# Generated from api_rspecta-0.0.3.gem by gem2rpm -*- rpm-spec -*- %global gem_name api_rspecta Name: rubygem-%{gem_name} Version: 0.0.3 Release: 1%{?dist} Summary: api_rspecta adds convenient methods to your RSpec to test JSON APIs License: MIT URL: https://github.com/SmartCloud/api_rspecta Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby # BuildRequires: rubygem(rspec) >= 3.0.0 # BuildRequires: rubygem(rspec) < 3.1 BuildArch: noarch %description `api_rspecta` adds following helper methods to test your JSON APIs with RSpec: **JSON:** - `#json` returns parsed `last_response.body` - `#refresh_json` reparses `last_response.body` - `#print_json` to `JSON.pretty_generate` last response JSON - `#json_has_key` tells you if passed json object has a `key` - `#json_has_keys` same as above but for a list of keys - `#json_has_no_key` is opposite to `#json_has_key` **Response:** - `should_respond_ok` checks if `last_response.status` was 200 - `should_respond_created` checks if `last_response.status` was 201 - `should_respond_with_no_content` checks if `last_response.status` was 204 - `should_respond_not_authenticated` checks if `last_response.status` was 401 - `should_respond_not_authorized` checks if `last_response.status` was 403 - `should_respond_not_found` checks if `last_response.status` was 404 - `should_respond_with_error_for` checks if `last_response.status` was 422 and that `json` has `errors` for passed `field` - `should_respond_with_errors_for` same as above but for a list of errors . %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} %build # Create the gem as gem install only works on a gem file gem build ../%{gem_name}-%{version}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %check pushd .%{gem_instdir} # rspec spec popd %files %dir %{gem_instdir} %exclude %{gem_instdir}/.gitignore %exclude %{gem_instdir}/.rvmrc %license %{gem_instdir}/LICENSE.txt %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %{gem_instdir}/Gemfile %doc %{gem_instdir}/README.md %{gem_instdir}/Rakefile %{gem_instdir}/api_rspecta.gemspec %{gem_instdir}/spec %changelog * Mon Feb 07 2022 mockbuilder - 0.0.3-1 - Initial package