rspec-httpd 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/README.md +27 -0
- data/Rakefile +18 -0
- data/VERSION +1 -0
- data/bin/console +13 -0
- data/bin/rubocop +29 -0
- data/lib/rspec-httpd.rb +1 -0
- data/rspec-httpd.gemspec +23 -0
- data/scripts/release +2 -0
- data/scripts/release.rb +92 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7badad2789ef213277988f266f4fa3eed8418c595468d9305fc0b5cfd8a02026
|
4
|
+
data.tar.gz: 9ed45ca4b37f7892049e30d652fb4e4da88f6fc24e33349fae70a4c8487bb34f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8a48e3e22248151783f734f6c6ef5a7daf0761eb486c8c7f2157f63b15d275468b7047135624e5f221f155a36fe21899cbc135e9a5e39e14471fad31c8a6b2a4
|
7
|
+
data.tar.gz: 11c6193614b73de4edd1d104fd79d239949584824ac5ad97d0118f017c701687b8831f98dd8b1fc6d922b10b396b0178393fd9a1e6a69a9ac4c1ebd2704dfb19
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# rspec-httpd
|
2
|
+
|
3
|
+
A gem to test HTTP servers with real requests.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
TODO
|
8
|
+
|
9
|
+
### Releasing a new gem version
|
10
|
+
|
11
|
+
TLDR: Do a `bundle exec rake release`.
|
12
|
+
|
13
|
+
- Releasing a gem version on the master branch:
|
14
|
+
|
15
|
+
rake release
|
16
|
+
|
17
|
+
- Releasing a gem version on the stable branch:
|
18
|
+
|
19
|
+
rake release:stable
|
20
|
+
|
21
|
+
These rake tasks automatically bump the version number. If you want to determine the target version yourself use
|
22
|
+
|
23
|
+
VERION=1.2.3 rake release
|
24
|
+
|
25
|
+
or
|
26
|
+
|
27
|
+
VERION=1.2.3 rake release:stable
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require "rubocop/rake_task"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
RuboCop::RakeTask.new(:rubocop)
|
6
|
+
|
7
|
+
desc "Run rspec and then rubocop"
|
8
|
+
task default: [:spec, :rubocop]
|
9
|
+
|
10
|
+
desc "release a new development gem version"
|
11
|
+
task :release do
|
12
|
+
sh "scripts/release.rb"
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "release a new stable gem version"
|
16
|
+
task "release:stable" do
|
17
|
+
sh "BRANCH=stable scripts/release.rb"
|
18
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2
|
data/bin/console
ADDED
data/bin/rubocop
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/lib/rspec-httpd.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "rspec/httpd"
|
data/rspec-httpd.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "rspec-httpd"
|
3
|
+
s.version = File.read("VERSION").chomp
|
4
|
+
s.date = "2019-03-01"
|
5
|
+
s.summary = "RSpec testing for HTTP requests"
|
6
|
+
s.description = "RSpec testing for HTTP requests"
|
7
|
+
s.authors = ["Enrico Thierbach"]
|
8
|
+
s.email = "eno@open-lab.org"
|
9
|
+
s.homepage = "https://github.com/radiospiel/rspec-httpd"
|
10
|
+
s.license = "Nonstandard"
|
11
|
+
s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR).reject { |f| f.match(%r{tasks/|spec/|log/|^\.}) }
|
12
|
+
|
13
|
+
# Runtime dependencies of this gem:
|
14
|
+
# s.add_dependency 'activesupport', '~> 4.2.10'
|
15
|
+
# s.add_dependency 'expectation', '1.1.1'
|
16
|
+
# s.add_dependency 'faraday', '> 0.9'
|
17
|
+
# s.add_dependency 'uri_template', '~> 0.7', '>= 0.7.0'
|
18
|
+
|
19
|
+
# Gems for dev and test env:
|
20
|
+
s.add_development_dependency "rake", "~> 12.0"
|
21
|
+
s.add_development_dependency "rspec", "~> 3.4"
|
22
|
+
s.add_development_dependency "rubocop", "~> 0.65.0"
|
23
|
+
end
|
data/scripts/release
ADDED
data/scripts/release.rb
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# -- helpers ------------------------------------------------------------------
|
4
|
+
|
5
|
+
def sys(cmd)
|
6
|
+
STDERR.puts "> #{cmd}"
|
7
|
+
system cmd
|
8
|
+
return true if $?.success?
|
9
|
+
|
10
|
+
STDERR.puts "> #{cmd} returned with exitstatus #{$?.exitstatus}"
|
11
|
+
$?.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
def sys!(cmd, error: nil)
|
15
|
+
return true if sys(cmd)
|
16
|
+
STDERR.puts error if error
|
17
|
+
exit 1
|
18
|
+
end
|
19
|
+
|
20
|
+
def die!(msg)
|
21
|
+
STDERR.puts msg
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
|
25
|
+
ROOT = File.expand_path("#{File.dirname(__FILE__)}/..")
|
26
|
+
|
27
|
+
GEMSPEC = Dir.glob("*.gemspec").first || die!("Missing gemspec file.")
|
28
|
+
|
29
|
+
# -- Version reading and bumping ----------------------------------------------
|
30
|
+
|
31
|
+
module Version
|
32
|
+
extend self
|
33
|
+
|
34
|
+
VERSION_FILE = "#{Dir.getwd}/VERSION"
|
35
|
+
|
36
|
+
def read_version
|
37
|
+
version = File.exist?(VERSION_FILE) ? File.read(VERSION_FILE) : "0.0.1"
|
38
|
+
version.chomp!
|
39
|
+
raise "Invalid version number in #{VERSION_FILE}" unless version =~ /^\d+\.\d+\.\d+$/
|
40
|
+
version
|
41
|
+
end
|
42
|
+
|
43
|
+
def auto_version_bump
|
44
|
+
old_version_number = read_version
|
45
|
+
old = old_version_number.split('.')
|
46
|
+
|
47
|
+
current = old[0..-2] << old[-1].next
|
48
|
+
current.join('.')
|
49
|
+
end
|
50
|
+
|
51
|
+
def bump_version
|
52
|
+
next_version = ENV["VERSION"] || auto_version_bump
|
53
|
+
File.open(VERSION_FILE, "w") { |io| io.write next_version }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# -- check, bump, release a new gem version -----------------------------------
|
58
|
+
|
59
|
+
Dir.chdir ROOT
|
60
|
+
$BASE_BRANCH = ENV['BRANCH'] || 'master'
|
61
|
+
|
62
|
+
# ENV["BUNDLE_GEMFILE"] = "#{Dir.getwd}/Gemfile"
|
63
|
+
# sys! "bundle install"
|
64
|
+
|
65
|
+
sys! "git diff --exit-code > /dev/null", error: 'There are unstaged changes in your working directory'
|
66
|
+
sys! "git diff --cached --exit-code > /dev/null", error: 'There are staged but uncommitted changes'
|
67
|
+
|
68
|
+
sys! "git checkout #{$BASE_BRANCH}"
|
69
|
+
sys! "git pull"
|
70
|
+
|
71
|
+
Version.bump_version
|
72
|
+
version = Version.read_version
|
73
|
+
|
74
|
+
sys! "git add VERSION"
|
75
|
+
sys! "git commit -m \"bump gem to v#{version}\""
|
76
|
+
sys! "git tag -a v#{version} -m \"Tag #{version}\""
|
77
|
+
|
78
|
+
sys! "gem build #{GEMSPEC}"
|
79
|
+
|
80
|
+
sys! "git push origin #{$BASE_BRANCH}"
|
81
|
+
sys! 'git push --tags --force'
|
82
|
+
|
83
|
+
sys! "gem push #{Dir.glob('*.gem').first}"
|
84
|
+
|
85
|
+
sys! "mkdir -p pkg"
|
86
|
+
sys! "mv *.gem pkg"
|
87
|
+
|
88
|
+
STDERR.puts <<-MSG
|
89
|
+
================================================================================
|
90
|
+
Thank you for releasing a new gem version. You made my day.
|
91
|
+
================================================================================
|
92
|
+
MSG
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-httpd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Enrico Thierbach
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '12.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '12.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.65.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.65.0
|
55
|
+
description: RSpec testing for HTTP requests
|
56
|
+
email: eno@open-lab.org
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- Gemfile
|
62
|
+
- README.md
|
63
|
+
- Rakefile
|
64
|
+
- VERSION
|
65
|
+
- bin/console
|
66
|
+
- bin/rubocop
|
67
|
+
- lib/rspec-httpd.rb
|
68
|
+
- rspec-httpd.gemspec
|
69
|
+
- scripts/release
|
70
|
+
- scripts/release.rb
|
71
|
+
homepage: https://github.com/radiospiel/rspec-httpd
|
72
|
+
licenses:
|
73
|
+
- Nonstandard
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.7.6
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: RSpec testing for HTTP requests
|
95
|
+
test_files: []
|