rspec-mock 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3837a1c0663bfdd845233709d0c1efc2ded6c14448de1305c52b5d48f0b9c0e0
4
+ data.tar.gz: fb8b268129a767ed920ffe88a7502ba0a34a80304e9f834e6c01bf974fda96be
5
+ SHA512:
6
+ metadata.gz: aa04c73ff49511dde2fd8188562d4953f2745f5ed9c6c3f4289e95870ddd8b44297153007f686573833ecd28018c489cab2b064f334bceb08a0ec9acb40d5a3e
7
+ data.tar.gz: e78dd5026066493baa6bc74323262570c0490d45aeaa1d43febaa851518a4c84ceac5fdc711f54465427d3cd25cf6e76d9496b41dffe4b693aa50c416ede00ce
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.5.0
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Vladislav Trotsenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'rspec-mock'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ module Core
5
+ class Configuration
6
+ include RSpec::Mock::Configuration
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ module Mock
5
+ module Configuration
6
+ def rspec_mock
7
+ RSpec::Mocks.configuration.tap do |config|
8
+ yield config if block_given?
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ module Mock
5
+ class Context
6
+ include RSpec::Mocks::ExampleMethods
7
+ include RSpec::Matchers
8
+
9
+ def initialize(example_group)
10
+ @example_group = example_group
11
+ end
12
+
13
+ def method_missing(method, *args, &block)
14
+ if @example_group.respond_to?(method)
15
+ @example_group.send(method, *args, &block)
16
+ else
17
+ super
18
+ end
19
+ end
20
+
21
+ def respond_to_missing?(method, include_private = false)
22
+ @example_group.respond_to?(method, include_private) || super
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rspec/core'
4
+ require 'rspec/mocks'
5
+
6
+ module RSpec
7
+ module Mock
8
+ require_relative 'configuration'
9
+ require_relative 'context'
10
+ require_relative 'methods'
11
+ require_relative 'version'
12
+ end
13
+
14
+ module Core
15
+ require_relative '../core/configuration'
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ module Mock
5
+ module Methods
6
+ def rspec_mock(&block)
7
+ return unless block_given?
8
+
9
+ RSpec::Mocks.with_temporary_scope do
10
+ RSpec::Mock::Context.new(self).instance_eval(&block)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ module Mock
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
data/lib/rspec/mock.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'mock/core'
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/rspec/mock/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'rspec-mock'
7
+ spec.version = RSpec::Mock::VERSION
8
+ spec.authors = ['Vladislav Trotsenko']
9
+ spec.email = %w[admin@bestweb.com.ua]
10
+
11
+ spec.summary = %(RSpec::Mock - seamless migration from third-party mocks to RSpec built-in mocking framework)
12
+ spec.description = %(RSpec::Mock - seamless migration from third-party mocks to RSpec built-in mocking framework.)
13
+
14
+ spec.homepage = 'https://github.com/mocktools/ruby-rspec-mock'
15
+ spec.license = 'MIT'
16
+
17
+ spec.metadata = {
18
+ 'homepage_uri' => 'https://github.com/mocktools/ruby-rspec-mock',
19
+ 'changelog_uri' => 'https://github.com/mocktools/ruby-rspec-mock/blob/master/CHANGELOG.md',
20
+ 'source_code_uri' => 'https://github.com/mocktools/ruby-rspec-mock',
21
+ 'documentation_uri' => 'https://github.com/mocktools/ruby-rspec-mock/blob/master/README.md',
22
+ 'bug_tracker_uri' => 'https://github.com/mocktools/ruby-rspec-mock/issues'
23
+ }
24
+
25
+ spec.required_ruby_version = '>= 2.5.0'
26
+ spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(bin|lib)/|.ruby-version|rspec-mock.gemspec|LICENSE}) }
27
+ spec.require_paths = %w[lib]
28
+
29
+ spec.add_runtime_dependency 'rspec-core', '~> 3.13', '>= 3.13.2'
30
+ spec.add_runtime_dependency 'rspec-mocks', '~> 3.13', '>= 3.13.2'
31
+
32
+ spec.add_development_dependency 'rspec', '~> 3.13'
33
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-mock
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Vladislav Trotsenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-11-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.13'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.13.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.13'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.13.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec-mocks
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.13'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.13.2
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.13'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.13.2
53
+ - !ruby/object:Gem::Dependency
54
+ name: rspec
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '3.13'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3.13'
67
+ description: RSpec::Mock - seamless migration from third-party mocks to RSpec built-in
68
+ mocking framework.
69
+ email:
70
+ - admin@bestweb.com.ua
71
+ executables: []
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - ".ruby-version"
76
+ - LICENSE.txt
77
+ - bin/console
78
+ - bin/setup
79
+ - lib/rspec/core/configuration.rb
80
+ - lib/rspec/mock.rb
81
+ - lib/rspec/mock/configuration.rb
82
+ - lib/rspec/mock/context.rb
83
+ - lib/rspec/mock/core.rb
84
+ - lib/rspec/mock/methods.rb
85
+ - lib/rspec/mock/version.rb
86
+ - rspec-mock.gemspec
87
+ homepage: https://github.com/mocktools/ruby-rspec-mock
88
+ licenses:
89
+ - MIT
90
+ metadata:
91
+ homepage_uri: https://github.com/mocktools/ruby-rspec-mock
92
+ changelog_uri: https://github.com/mocktools/ruby-rspec-mock/blob/master/CHANGELOG.md
93
+ source_code_uri: https://github.com/mocktools/ruby-rspec-mock
94
+ documentation_uri: https://github.com/mocktools/ruby-rspec-mock/blob/master/README.md
95
+ bug_tracker_uri: https://github.com/mocktools/ruby-rspec-mock/issues
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 2.5.0
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubygems_version: 3.2.15
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: RSpec::Mock - seamless migration from third-party mocks to RSpec built-in
115
+ mocking framework
116
+ test_files: []