r_spec 0.2.0 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8950ebeb7e88526f836143ac5a500834ff3cc75d
4
- data.tar.gz: 2a9e7ec9ceee6ae3077503415758e184c10128e1
2
+ SHA256:
3
+ metadata.gz: 4ffdec1b2b30ba9271129d9332872597dbc00204d92495e4cbfa1f3b00896d8f
4
+ data.tar.gz: 59c6a96b46b865ea72ecd3b84f80189f8173550447bed8820e1156130ba02c67
5
5
  SHA512:
6
- metadata.gz: 8edf8760b374bf3f1ab3fdc8a8ab4f8c16e13c8853f57b158a47ce3af4098f4a89c15be1f8505bf352461cfd0764b174d7a0fffddb3f13a36a95903ddb220cdf
7
- data.tar.gz: 9f1087e9d92a22e293f59d6e23f0c98028508ef12f887fe0b8ba19d25bf02136644285a6f0005952b862fa306b6f8a81ef804135993d9667ec371051b65043a8
6
+ metadata.gz: 60c275a1bbe617d37623707f45cd7d8cb0673354a7e1751873ecf08e84160f77030530a284b0d759cb32705599a64d5a0bb2287acd10c8dbb3bd0f8b0a1328fa
7
+ data.tar.gz: 19f8fa7e5727b596a11d2865fedf26953198d09604cdc2150ef037e88d78913305c5a257d4289e270a3697f4555524973df46ea081da1502082c25b864704a4d
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Cyril Wack
3
+ Copyright (c) 2015-2021 Cyril Kato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,116 +1,102 @@
1
- # R Spec
1
+ # RSpec clone
2
2
 
3
- [![Build Status](https://travis-ci.org/cyril/r_spec.svg?branch=master)][travis]
4
- [![Gem Version](https://badge.fury.io/rb/r_spec.svg)][gem]
5
- [![Inline docs](http://inch-ci.org/github/cyril/r_spec.svg?branch=master)][inchpages]
6
- [![Documentation](http://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
3
+ A minimalist [RSpec](https://github.com/rspec/rspec) clone with an emphasis on correctness and simplicity.
7
4
 
8
- > A small [Rspec](https://github.com/rspec/rspec) clone based on [Fix specing framework](https://github.com/fixrb/fix).
5
+ ![What did you expect?](https://github.com/cyril/r_spec.rb/raw/main/img/what-did-you-expect.jpg)
9
6
 
10
- ***
7
+ ## Status
11
8
 
12
- :warning: Important:
9
+ [![Gem Version](https://badge.fury.io/rb/r_spec.svg)](https://badge.fury.io/rb/r_spec)
10
+ [![Build Status](https://travis-ci.org/cyril/r_spec.rb.svg?branch=main)](https://travis-ci.org/cyril/r_spec.rb)
11
+ [![Inline Docs](https://inch-ci.org/github/cyril/r_spec.rb.svg)](https://inch-ci.org/github/cyril/r_spec.rb)
13
12
 
14
- To avoid confusion in the community, please note that the gem of this project is **not [rspec](https://rubygems.org/gems/rspec)**, it is **[r_spec](https://rubygems.org/gems/r_spec)** (meaning _Ruby Spec_).
13
+ ## Goal
15
14
 
16
- This project is totally independent of [rspec.info](http://rspec.info/).
15
+ This clone attempts to provide most of RSpec's DSL without magic power, so that its code could reasonably become less complex than the code of your application.
17
16
 
18
- Also, while the `RSpec` module is the same (I follow [the gem naming convention](http://guides.rubygems.org/name-your-gem/#use-underscores-for-multiple-words), the **r_spec** internal is quite different than **rspec** due to its [Ruby Fix](http://fixrb.org/) dependency.
17
+ ## Some differences
19
18
 
20
- ***
19
+ * Less features and an implementation with much less code complexity.
20
+ * Spec files can also be executed directly with the `ruby` executable.
21
+ * There cannot be more than one expectation per example.
22
+ * There is no option to activate monkey-patching.
23
+ * Does not rely on hacks such as `at_exit` hook to trigger the tests.
24
+ * Built-in matchers do not trust _actual_ and do not send it any message.
21
25
 
22
- ## Contact
23
-
24
- * Home page: https://github.com/cyril/r_spec
25
- * Bugs/issues: https://github.com/cyril/r_spec/issues
26
-
27
- ## Rubies
26
+ ## Important ⚠️
28
27
 
29
- * [MRI](https://www.ruby-lang.org/)
30
- * [Rubinius](http://rubini.us/)
31
- * [JRuby](http://jruby.org/)
32
-
33
- ## Installation
28
+ To avoid confusion in the community, please note that:
34
29
 
35
- __R Spec__ is cryptographically signed.
30
+ - the gem of this project is **not [`rspec`](https://rubygems.org/gems/rspec)**,
31
+ it is **[`r_spec`](https://rubygems.org/gems/r_spec)**;
32
+ - this project is totally independent of [rspec.info](https://rspec.info/).
36
33
 
37
- To be sure the gem you install hasn't been tampered with, add my public key (if you haven't already) as a trusted certificate:
34
+ ### Note
38
35
 
39
- $ gem cert --add <(curl -Ls https://raw.github.com/cyril/r_spec/master/certs/gem-cyril-public_cert.pem)
40
- $ gem install r_spec -P HighSecurity
36
+ Following [RubyGems naming conventions](https://guides.rubygems.org/name-your-gem/#use-underscores-for-multiple-words), the module name for this project is `RSpec`.
41
37
 
42
- The `HighSecurity` trust profile will verify all gems. All of __R Spec__'s dependencies are signed.
38
+ ## Installation
43
39
 
44
- Or add this line to your application's Gemfile:
40
+ Add this line to your application's Gemfile:
45
41
 
46
42
  ```ruby
47
- gem 'r_spec'
43
+ gem "r_spec", ">= 1.0.0.beta1"
48
44
  ```
49
45
 
50
46
  And then execute:
51
47
 
52
- $ bundle
48
+ ```sh
49
+ bundle
50
+ ```
51
+
52
+ Or install it yourself as:
53
+
54
+ ```sh
55
+ gem install r_spec --pre
56
+ ```
53
57
 
54
58
  ## Usage
55
59
 
56
60
  Given this `greeting_spec.rb` spec:
57
61
 
58
62
  ```ruby
59
- require 'r_spec'
63
+ require "r_spec"
60
64
 
61
- greeting = 'Hello, world!'
65
+ greeting = "Hello, world!"
62
66
 
63
- RSpec.describe 'Test' do
64
- context 'Alice' do
65
- before { greeting.gsub!('world', 'Alice') }
66
- it { expect(greeting).to eql 'Hello, Alice!' }
67
+ RSpec.describe String do
68
+ context "Alice" do
69
+ before { greeting.gsub!("world", "Alice") }
70
+ it { expect(greeting).to eql "Hello, Alice!" }
67
71
  end
68
72
 
69
- context 'Bob' do
70
- before { greeting.gsub!('world', 'Bob') }
71
- it { expect(greeting).to eql 'Hello, Bob!' }
73
+ context "Bob" do
74
+ before { greeting.gsub!("world", "Bob") }
75
+ it { expect(greeting).to eql "Hello, Bob!" }
72
76
  end
73
77
  end
74
78
  ```
75
79
 
76
80
  It can be tested in the console with the command:
77
81
 
78
- $ ruby greeting_spec.rb
79
- ..
80
-
81
- Ran 2 tests in 0.010994 seconds
82
- 100% compliant - 0 infos, 0 failures, 0 errors
83
-
84
- ## Security
82
+ ```sh
83
+ ruby greeting_spec.rb
84
+ ```
85
85
 
86
- As a basic form of security __R Spec__ provides a set of SHA512 checksums for
87
- every Gem release. These checksums can be found in the `checksum/` directory.
88
- Although these checksums do not prevent malicious users from tampering with a
89
- built Gem they can be used for basic integrity verification purposes.
86
+ > ..
87
+ >
88
+ > Ran 2 tests in 0.010994 seconds
89
+ > 100% compliant - 0 infos, 0 failures, 0 errors
90
90
 
91
- The checksum of a file can be checked using the `sha512sum` command. For
92
- example:
91
+ ## Contact
93
92
 
94
- $ sha512sum pkg/r_spec-0.1.0.gem
95
- e9e35e1953104e2d428b0f217e418db3c1baecd9e011b2545f9fcba4ff7e3bba674c6b928b3d8db842a139cd7cc9806d77ebdc7f710ece4f2aecb343703e2451 pkg/r_spec-0.1.0.gem
93
+ * Home page: https://r-spec.dev/
94
+ * Source code: https://github.com/cyril/r_spec.rb
96
95
 
97
96
  ## Versioning
98
97
 
99
- __R Spec__ follows [Semantic Versioning 2.0](http://semver.org/).
100
-
101
- ## Contributing
102
-
103
- 1. [Fork it](https://github.com/cyril/r_spec/fork)
104
- 2. Create your feature branch (`git checkout -b my-new-feature`)
105
- 3. Commit your changes (`git commit -am 'Add some feature'`)
106
- 4. Push to the branch (`git push origin my-new-feature`)
107
- 5. Create a new Pull Request
98
+ __R_Spec__ follows [Semantic Versioning 2.0](https://semver.org/).
108
99
 
109
100
  ## License
110
101
 
111
- See `LICENSE.md` file.
112
-
113
- [gem]: https://rubygems.org/gems/r_spec
114
- [travis]: https://travis-ci.org/cyril/r_spec
115
- [inchpages]: http://inch-ci.org/github/cyril/r_spec/
116
- [rubydoc]: http://rubydoc.info/gems/r_spec/frames
102
+ The [gem](https://rubygems.org/gems/r_spec) is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/lib/r_spec.rb CHANGED
@@ -1,31 +1,16 @@
1
- require 'matchi/rspec'
2
- require 'fix/expect'
3
- require 'fix/its'
1
+ # frozen_string_literal: true
4
2
 
5
- # Namespace for the R Spec framework.
3
+ # Namespace for the RSpec framework.
6
4
  #
7
5
  # @api public
8
6
  #
9
7
  module RSpec
10
8
  # Specs are built with this method.
11
- #
12
- # @example The answer must be equal to 42.
13
- # describe('the answer') do
14
- # it { expect(42).to be 42 }
15
- # end
16
- #
17
- # @param front_object [#object_id] The front object.
18
- # @param options [Hash] Some options.
19
- # @param specs [Proc] The set of specs.
20
- #
21
- # @raise [SystemExit] The result of the test.
22
- def self.describe(front_object, options = {}, &specs)
23
- t = ::Fix::Test.new(front_object, options, &specs)
9
+ def self.describe(const, &block)
10
+ raise ::TypeError, const.class.inspect unless const.is_a?(::Module)
24
11
 
25
- print "#{t.report}" if options.fetch(:verbose, true)
26
- exit t.pass?
12
+ DSL.describe(const, &block)
27
13
  end
28
14
  end
29
15
 
30
- require_relative File.join 'fix', 'it'
31
- require_relative File.join 'fix', 'on'
16
+ require_relative File.join("r_spec", "dsl")
data/lib/r_spec/dsl.rb ADDED
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "expresenter"
4
+ require "matchi/rspec"
5
+ require "securerandom"
6
+
7
+ module RSpec
8
+ class DSL
9
+ def self.before(&block)
10
+ define_method(:initialize) do |*args, **kwargs|
11
+ super()
12
+ instance_exec(*args, **kwargs, &block)
13
+ end
14
+ end
15
+
16
+ def self.let(name, &block)
17
+ protected define_method(name.to_sym, &block)
18
+ end
19
+
20
+ def self.subject(&block)
21
+ let(__method__, &block)
22
+ end
23
+
24
+ def self.describe(const, &block)
25
+ desc = Test.const_set("Test#{random_str}", ::Class.new(self))
26
+
27
+ if const.is_a?(::Module)
28
+ desc.define_method(:described_class) { const }
29
+ desc.send(:protected, :described_class)
30
+ end
31
+
32
+ desc.instance_eval(&block)
33
+ desc
34
+ end
35
+
36
+ singleton_class.send(:alias_method, :context, :describe)
37
+
38
+ def self.it(name = "test_#{random_str.downcase}", &block)
39
+ raise ::ArgumentError, "Missing block for #{name.inspect} test" unless block
40
+
41
+ path_info = block.source_location.join(":")
42
+ print "\e[3m#{path_info}\e[23m "
43
+
44
+ i = example.new
45
+ i.instance_eval(&block)
46
+ end
47
+
48
+ private_class_method def self.example
49
+ ::Class.new(self) do
50
+ include ::Matchi::Helper
51
+
52
+ private
53
+
54
+ def expect(actual)
55
+ undef expect
56
+ undef is_expected
57
+
58
+ Expect.new(actual)
59
+ end
60
+
61
+ # rubocop:disable Naming/PredicateName
62
+ def is_expected
63
+ expect(subject)
64
+ end
65
+ # rubocop:enable Naming/PredicateName
66
+
67
+ def pending(description)
68
+ puts Requirement.pending(description).colored_string
69
+ end
70
+ end
71
+ end
72
+
73
+ private_class_method def self.random_str
74
+ ::SecureRandom.alphanumeric(5)
75
+ end
76
+ end
77
+ end
78
+
79
+ require_relative "expect"
80
+ require_relative "test"
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ # This class evaluate the expectation with the given value.
5
+ class Exam
6
+ # Execute the untested code from the given value against the matcher.
7
+ #
8
+ # @param actual [#object_id] The actual object to test.
9
+ # @param negate [Boolean] Positive or negative assertion?
10
+ # @param matcher [#matches?] The matcher.
11
+ def initialize(actual:, negate:, matcher:)
12
+ @actual = actual
13
+ @got = negate ^ matcher.matches? { actual }
14
+ end
15
+ # @return [#object_id] The actual value.
16
+ attr_reader :actual
17
+
18
+ # @return [Boolean] Report to the spec requirement level if the
19
+ # expectation is true or false.
20
+ attr_reader :got
21
+
22
+ # Report to the spec requirement if the test pass or fail.
23
+ #
24
+ # @return [Boolean] Report if the test pass or fail?
25
+ def valid?
26
+ got
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ class Expect
5
+ def initialize(actual)
6
+ @actual = actual
7
+ end
8
+
9
+ def to(matcher)
10
+ Requirement.new(actual: @actual, matcher: matcher, negate: false).call
11
+ end
12
+
13
+ def not_to(matcher)
14
+ Requirement.new(actual: @actual, matcher: matcher, negate: true).call
15
+ end
16
+ end
17
+ end
18
+
19
+ require_relative "requirement"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ # rubocop:disable Lint/InheritException
5
+ class Pending < ::NotImplementedError
6
+ end
7
+ # rubocop:enable Lint/InheritException
8
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "expresenter"
4
+
5
+ module RSpec
6
+ class Requirement
7
+ def self.pending(description)
8
+ ::Expresenter.call(true).new(
9
+ actual: nil,
10
+ error: Pending.new(description),
11
+ expected: nil,
12
+ got: nil,
13
+ matcher: :eql,
14
+ negate: false,
15
+ level: :MAY,
16
+ valid: false
17
+ )
18
+ end
19
+
20
+ # Initialize the requirement class.
21
+ #
22
+ # @param actual [#object_id] The actual object to test.
23
+ # @param matcher [#matches?] The matcher.
24
+ # @param negate [Boolean] Positive or negative assertion?
25
+ def initialize(actual:, matcher:, negate:)
26
+ @exam = Exam.new(actual: actual, negate: negate, matcher: matcher)
27
+ @matcher = matcher
28
+ @negate = negate
29
+ @result = expectation_result
30
+ end
31
+
32
+ # @return [Exam] The exam.
33
+ attr_reader :exam
34
+
35
+ # @return [#matches?] The matcher that performed a boolean comparison
36
+ # between the actual value and the expected value.
37
+ attr_reader :matcher
38
+
39
+ # @return [Expresenter::Fail, Expresenter::Pass] The test result.
40
+ attr_reader :result
41
+
42
+ # Evaluate the expectation.
43
+ #
44
+ # @return [Boolean] Report if the expectation pass or fail?
45
+ def pass?
46
+ exam.valid?
47
+ end
48
+
49
+ # The consequence of the expectation.
50
+ #
51
+ # @return [nil] The test passed.
52
+ # @raise [SystemExit] The test failed.
53
+ def call
54
+ if result.passed?
55
+ puts result.colored_string
56
+ else
57
+ abort result.colored_string
58
+ end
59
+ end
60
+
61
+ protected
62
+
63
+ # @note The boolean comparison between the actual value and the expected
64
+ # value can be evaluated to a negative assertion.
65
+ #
66
+ # @return [Boolean] Positive or negative assertion?
67
+ def negate?
68
+ @negate
69
+ end
70
+
71
+ # The result of the expectation.
72
+ #
73
+ # @return [Expresenter::Fail, Expresenter::Pass] The test result.
74
+ def expectation_result
75
+ ::Expresenter.call(pass?).new(
76
+ actual: exam.actual,
77
+ error: nil,
78
+ expected: matcher.expected,
79
+ got: exam.got,
80
+ negate: negate?,
81
+ valid: exam.valid?,
82
+ matcher: matcher.class.to_sym,
83
+ level: :MUST
84
+ )
85
+ end
86
+ end
87
+ end
88
+
89
+ require_relative "exam"
90
+ require_relative "pending"
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RSpec
4
+ # Set of tests.
5
+ #
6
+ # rubocop:disable Lint/EmptyClass
7
+ class Test
8
+ end
9
+ # rubocop:enable Lint/EmptyClass
10
+ end
metadata CHANGED
@@ -1,193 +1,191 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
- - Cyril Wack
7
+ - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRAwDgYDVQQDDAdjb250
14
- YWN0MRUwEwYKCZImiZPyLGQBGRYFY3lyaWwxFTATBgoJkiaJk/IsZAEZFgVlbWFp
15
- bDAeFw0xNTA3MzExMjExMDZaFw0xNjA3MzAxMjExMDZaMEAxEDAOBgNVBAMMB2Nv
16
- bnRhY3QxFTATBgoJkiaJk/IsZAEZFgVjeXJpbDEVMBMGCgmSJomT8ixkARkWBWVt
17
- YWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6hUEYoxnn1mtoaiK
18
- NiwjzVPqPgQCR9ZeYdWjLJ3UUG2h5Q6awJCnbaGr8LGGcKtveCDbOJRjtdKNuOTH
19
- O2FLTkf46nrMGiF+6/j//qh8o0EQHBRKIVMYkxZxZe4Fcqtdf1bWNMZuXeyoDjdt
20
- 4yiGfizbbTOu0gBf7Yrsv5DsL0a5CU/We7zxMfgGXCVb9PYkD+OWUMcTARYDKfYa
21
- nN9ECI7CFm/yXcsof/eIQA5EmJNmQnhx8B+8L6jDqQeSUAUrBZnC9CdloKOoqmEL
22
- weqM2g6LM932Ba74rEl4QlFRYDcs8kjr71UcvseHRCUkFr36j26OU8+gKelsTNdO
23
- 7OZNKQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
24
- LSJTN9h29D6bqOhp+vyvhyM0AF4wHgYDVR0RBBcwFYETY29udGFjdEBjeXJpbC5l
25
- bWFpbDAeBgNVHRIEFzAVgRNjb250YWN0QGN5cmlsLmVtYWlsMA0GCSqGSIb3DQEB
26
- BQUAA4IBAQArqCC1rUyGJlF0DF9ZhUOgggyROvO0/WroSI5zWgzdB8EU7RJpsDIV
27
- caGnpji7h0rQIGWQuJ6TL2fTFLfeGRFdIzRZwWC7TeXhcXngJHZxSjDBt2OpfM8A
28
- P5eElSQS9iJCetBGGMyt354PfgZkg3URaC+JA6mdEisdtEdo64ElnMsLg9shCqye
29
- JSR3BbejbyPVva0/MHKD+dR6RswlcM9KMiYOXQml7a/kH6huOHvVq9gj5xC2ih8W
30
- dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
31
- 0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
32
- -----END CERTIFICATE-----
33
- date: 2015-10-31 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2021-05-30 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
- name: fix-expect
14
+ name: expresenter
37
15
  requirement: !ruby/object:Gem::Requirement
38
16
  requirements:
39
17
  - - "~>"
40
18
  - !ruby/object:Gem::Version
41
- version: 0.3.0
19
+ version: 1.2.0
42
20
  type: :runtime
43
21
  prerelease: false
44
22
  version_requirements: !ruby/object:Gem::Requirement
45
23
  requirements:
46
24
  - - "~>"
47
25
  - !ruby/object:Gem::Version
48
- version: 0.3.0
26
+ version: 1.2.0
49
27
  - !ruby/object:Gem::Dependency
50
- name: fix-its
28
+ name: matchi-rspec
51
29
  requirement: !ruby/object:Gem::Requirement
52
30
  requirements:
53
31
  - - "~>"
54
32
  - !ruby/object:Gem::Version
55
- version: 0.4.0
33
+ version: 1.1.0
56
34
  type: :runtime
57
35
  prerelease: false
58
36
  version_requirements: !ruby/object:Gem::Requirement
59
37
  requirements:
60
38
  - - "~>"
61
39
  - !ruby/object:Gem::Version
62
- version: 0.4.0
40
+ version: 1.1.0
63
41
  - !ruby/object:Gem::Dependency
64
- name: matchi-rspec
42
+ name: bundler
65
43
  requirement: !ruby/object:Gem::Requirement
66
44
  requirements:
67
- - - "~>"
45
+ - - ">="
68
46
  - !ruby/object:Gem::Version
69
- version: 0.0.2
70
- type: :runtime
47
+ version: '0'
48
+ type: :development
71
49
  prerelease: false
72
50
  version_requirements: !ruby/object:Gem::Requirement
73
51
  requirements:
74
- - - "~>"
52
+ - - ">="
75
53
  - !ruby/object:Gem::Version
76
- version: 0.0.2
54
+ version: '0'
77
55
  - !ruby/object:Gem::Dependency
78
- name: bundler
56
+ name: rake
79
57
  requirement: !ruby/object:Gem::Requirement
80
58
  requirements:
81
- - - "~>"
59
+ - - ">="
82
60
  - !ruby/object:Gem::Version
83
- version: '1.10'
61
+ version: '0'
84
62
  type: :development
85
63
  prerelease: false
86
64
  version_requirements: !ruby/object:Gem::Requirement
87
65
  requirements:
88
- - - "~>"
66
+ - - ">="
89
67
  - !ruby/object:Gem::Version
90
- version: '1.10'
68
+ version: '0'
91
69
  - !ruby/object:Gem::Dependency
92
- name: rake
70
+ name: rubocop-md
93
71
  requirement: !ruby/object:Gem::Requirement
94
72
  requirements:
95
- - - "~>"
73
+ - - ">="
96
74
  - !ruby/object:Gem::Version
97
- version: '10.4'
75
+ version: '0'
98
76
  type: :development
99
77
  prerelease: false
100
78
  version_requirements: !ruby/object:Gem::Requirement
101
79
  requirements:
102
- - - "~>"
80
+ - - ">="
103
81
  - !ruby/object:Gem::Version
104
- version: '10.4'
82
+ version: '0'
105
83
  - !ruby/object:Gem::Dependency
106
- name: yard
84
+ name: rubocop-performance
107
85
  requirement: !ruby/object:Gem::Requirement
108
86
  requirements:
109
- - - "~>"
87
+ - - ">="
110
88
  - !ruby/object:Gem::Version
111
- version: '0.8'
89
+ version: '0'
112
90
  type: :development
113
91
  prerelease: false
114
92
  version_requirements: !ruby/object:Gem::Requirement
115
93
  requirements:
116
- - - "~>"
94
+ - - ">="
117
95
  - !ruby/object:Gem::Version
118
- version: '0.8'
96
+ version: '0'
119
97
  - !ruby/object:Gem::Dependency
120
- name: simplecov
98
+ name: rubocop-rake
121
99
  requirement: !ruby/object:Gem::Requirement
122
100
  requirements:
123
- - - "~>"
101
+ - - ">="
124
102
  - !ruby/object:Gem::Version
125
- version: '0.10'
103
+ version: '0'
126
104
  type: :development
127
105
  prerelease: false
128
106
  version_requirements: !ruby/object:Gem::Requirement
129
107
  requirements:
130
- - - "~>"
108
+ - - ">="
131
109
  - !ruby/object:Gem::Version
132
- version: '0.10'
110
+ version: '0'
133
111
  - !ruby/object:Gem::Dependency
134
- name: rubocop
112
+ name: rubocop-rspec
135
113
  requirement: !ruby/object:Gem::Requirement
136
114
  requirements:
137
- - - "~>"
115
+ - - ">="
138
116
  - !ruby/object:Gem::Version
139
- version: '0.34'
117
+ version: '0'
140
118
  type: :development
141
119
  prerelease: false
142
120
  version_requirements: !ruby/object:Gem::Requirement
143
121
  requirements:
144
- - - "~>"
122
+ - - ">="
145
123
  - !ruby/object:Gem::Version
146
- version: '0.34'
124
+ version: '0'
147
125
  - !ruby/object:Gem::Dependency
148
- name: spectus
126
+ name: rubocop-thread_safety
149
127
  requirement: !ruby/object:Gem::Requirement
150
128
  requirements:
151
- - - "~>"
129
+ - - ">="
152
130
  - !ruby/object:Gem::Version
153
- version: '3.0'
131
+ version: '0'
154
132
  type: :development
155
133
  prerelease: false
156
134
  version_requirements: !ruby/object:Gem::Requirement
157
135
  requirements:
158
- - - "~>"
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
159
151
  - !ruby/object:Gem::Version
160
- version: '3.0'
161
- description: A small Rspec clone based on Fix specing framework.
162
- email:
163
- - contact@cyril.email
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: yard
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: A minimalist RSpec clone with an emphasis on correctness and simplicity.
168
+ email: contact@cyril.email
164
169
  executables: []
165
170
  extensions: []
166
171
  extra_rdoc_files: []
167
172
  files:
168
- - ".gitignore"
169
- - ".travis.yml"
170
- - ".yardopts"
171
- - CODE_OF_CONDUCT.md
172
- - Gemfile
173
173
  - LICENSE.md
174
174
  - README.md
175
- - Rakefile
176
- - VERSION.semver
177
- - bin/console
178
- - bin/setup
179
- - certs/gem-cyril-public_cert.pem
180
- - checksum/r_spec-0.1.0.gem.sha512
181
- - checksum/r_spec-0.1.1.gem.sha512
182
- - lib/fix/it.rb
183
- - lib/fix/on.rb
184
175
  - lib/r_spec.rb
185
- - pkg_checksum
186
- - r_spec.gemspec
187
- homepage: https://github.com/cyril/r_spec
176
+ - lib/r_spec/dsl.rb
177
+ - lib/r_spec/exam.rb
178
+ - lib/r_spec/expect.rb
179
+ - lib/r_spec/pending.rb
180
+ - lib/r_spec/requirement.rb
181
+ - lib/r_spec/test.rb
182
+ homepage: https://r-spec.dev/
188
183
  licenses:
189
184
  - MIT
190
- metadata: {}
185
+ metadata:
186
+ bug_tracker_uri: https://github.com/cyril/r_spec.rb/issues
187
+ documentation_uri: https://rubydoc.info/gems/r_spec
188
+ source_code_uri: https://github.com/cyril/r_spec.rb
191
189
  post_install_message:
192
190
  rdoc_options: []
193
191
  require_paths:
@@ -196,17 +194,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
194
  requirements:
197
195
  - - ">="
198
196
  - !ruby/object:Gem::Version
199
- version: '0'
197
+ version: 2.7.0
200
198
  required_rubygems_version: !ruby/object:Gem::Requirement
201
199
  requirements:
202
- - - ">="
200
+ - - ">"
203
201
  - !ruby/object:Gem::Version
204
- version: '0'
202
+ version: 1.3.1
205
203
  requirements: []
206
- rubyforge_project:
207
- rubygems_version: 2.4.5.1
204
+ rubygems_version: 3.1.6
208
205
  signing_key:
209
206
  specification_version: 4
210
- summary: Rspec clone with Fix.
207
+ summary: A minimalist RSpec clone
211
208
  test_files: []
212
- has_rdoc:
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
Binary file
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.ruby-version
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
- *.gem
data/.travis.yml DELETED
@@ -1,15 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- script: 'bundle exec rake test:coverage --trace'
5
- before_install:
6
- - gem install bundler
7
- rvm:
8
- - 1.9.3
9
- - 2.0
10
- - 2.1
11
- - 2.2
12
- - ruby-head
13
- - jruby
14
- - jruby-head
15
- - rbx-2
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- - README.md
data/CODE_OF_CONDUCT.md DELETED
@@ -1,13 +0,0 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
-
5
- We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
-
7
- Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
-
9
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
-
11
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
-
13
- This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
data/Rakefile DELETED
@@ -1,20 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
- require 'rubocop/rake_task'
4
-
5
- RuboCop::RakeTask.new
6
-
7
- Rake::TestTask.new do |t|
8
- t.verbose = true
9
- t.warning = true
10
- end
11
-
12
- namespace :test do
13
- task :coverage do
14
- ENV['COVERAGE'] = 'true'
15
- Rake::Task['test'].invoke
16
- end
17
- end
18
-
19
- task(:doc_stats) { ruby '-S yard stats' }
20
- task default: [:test, :doc_stats, :rubocop]
data/VERSION.semver DELETED
@@ -1 +0,0 @@
1
- 0.2.0
data/bin/console DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'r_spec'
5
-
6
- require 'irb'
7
- IRB.start
data/bin/setup DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
@@ -1,21 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRAwDgYDVQQDDAdjb250
3
- YWN0MRUwEwYKCZImiZPyLGQBGRYFY3lyaWwxFTATBgoJkiaJk/IsZAEZFgVlbWFp
4
- bDAeFw0xNTA3MzExMjExMDZaFw0xNjA3MzAxMjExMDZaMEAxEDAOBgNVBAMMB2Nv
5
- bnRhY3QxFTATBgoJkiaJk/IsZAEZFgVjeXJpbDEVMBMGCgmSJomT8ixkARkWBWVt
6
- YWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6hUEYoxnn1mtoaiK
7
- NiwjzVPqPgQCR9ZeYdWjLJ3UUG2h5Q6awJCnbaGr8LGGcKtveCDbOJRjtdKNuOTH
8
- O2FLTkf46nrMGiF+6/j//qh8o0EQHBRKIVMYkxZxZe4Fcqtdf1bWNMZuXeyoDjdt
9
- 4yiGfizbbTOu0gBf7Yrsv5DsL0a5CU/We7zxMfgGXCVb9PYkD+OWUMcTARYDKfYa
10
- nN9ECI7CFm/yXcsof/eIQA5EmJNmQnhx8B+8L6jDqQeSUAUrBZnC9CdloKOoqmEL
11
- weqM2g6LM932Ba74rEl4QlFRYDcs8kjr71UcvseHRCUkFr36j26OU8+gKelsTNdO
12
- 7OZNKQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
13
- LSJTN9h29D6bqOhp+vyvhyM0AF4wHgYDVR0RBBcwFYETY29udGFjdEBjeXJpbC5l
14
- bWFpbDAeBgNVHRIEFzAVgRNjb250YWN0QGN5cmlsLmVtYWlsMA0GCSqGSIb3DQEB
15
- BQUAA4IBAQArqCC1rUyGJlF0DF9ZhUOgggyROvO0/WroSI5zWgzdB8EU7RJpsDIV
16
- caGnpji7h0rQIGWQuJ6TL2fTFLfeGRFdIzRZwWC7TeXhcXngJHZxSjDBt2OpfM8A
17
- P5eElSQS9iJCetBGGMyt354PfgZkg3URaC+JA6mdEisdtEdo64ElnMsLg9shCqye
18
- JSR3BbejbyPVva0/MHKD+dR6RswlcM9KMiYOXQml7a/kH6huOHvVq9gj5xC2ih8W
19
- dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
20
- 0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
21
- -----END CERTIFICATE-----
@@ -1 +0,0 @@
1
- 2988d048456c0dcc53bd2c8c45d8fd0f7de49e1f2bb0a3aca0749671b4baa4376e44e25d05f9ee457fe024872155ce93c8fe5c5e03fdcd494962d69805c5fce3
@@ -1 +0,0 @@
1
- 541eb96ff91798d807dc5b0bd71dab3e5c17358bc0e5bca8784607b8de0c8e9532011e958e152fb4a22bc653d9af13bd5edaf0989ff77c7941004f03ad0f29be
data/lib/fix/it.rb DELETED
@@ -1,10 +0,0 @@
1
- # Namespace for the Fix framework.
2
- module Fix
3
- # Override Fix's It class.
4
- class It
5
- # @return [Class] The class of the described object.
6
- def described_class
7
- subject.is_a?(::Class) ? subject : subject.class
8
- end
9
- end
10
- end
data/lib/fix/on.rb DELETED
@@ -1,43 +0,0 @@
1
- # Namespace for the Fix framework.
2
- module Fix
3
- # Override Fix's On class.
4
- class On
5
- # Useful to perform side-effects, e.g., add something in to a database.
6
- #
7
- # @note To declare an instance variable, use the `let` helper instead.
8
- #
9
- # @param block [Proc] The block to call.
10
- #
11
- # @return [#object_id] The given block.
12
- def before(*, &block)
13
- block.call
14
- end
15
-
16
- # @param another_front_object [#object_id] Override the front object.
17
- # @param specs [Proc] A set of specs.
18
- #
19
- # @return [Array] List of results.
20
- def describe(another_front_object, *, &specs)
21
- o = On.new(another_front_object,
22
- results,
23
- challenges,
24
- helpers.dup,
25
- configuration)
26
-
27
- o.instance_eval(&specs)
28
- end
29
-
30
- # Override the implicit subject.
31
- #
32
- # @param block [Proc, nil] Another subject inside a block.
33
- #
34
- # @return [#object_id] The subject.
35
- def subject(&block)
36
- if block_given?
37
- @described = block.call
38
- else
39
- super
40
- end
41
- end
42
- end
43
- end
data/pkg_checksum DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'digest/sha2'
4
-
5
- gemname = 'r_spec'.to_sym
6
- ARGV[0] = File.read('VERSION.semver').chomp if ARGV[0].nil?
7
- built_gem_path = "pkg/#{gemname}-#{ARGV[0]}.gem"
8
- checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
9
- checksum_path = "checksum/#{gemname}-#{ARGV[0]}.gem.sha512"
10
-
11
- File.open(checksum_path, 'w') { |f| f.write("#{checksum}\n") }
data/r_spec.gemspec DELETED
@@ -1,31 +0,0 @@
1
- Gem::Specification.new do |spec|
2
- spec.name = 'r_spec'
3
- spec.version = File.read('VERSION.semver').chomp
4
- spec.authors = ['Cyril Wack']
5
- spec.email = ['contact@cyril.email']
6
-
7
- spec.summary = 'Rspec clone with Fix.'
8
- spec.description = 'A small Rspec clone based on Fix specing framework.'
9
- spec.homepage = 'https://github.com/cyril/r_spec'
10
- spec.license = 'MIT'
11
-
12
- spec.files =
13
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
14
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
15
- spec.require_paths = ['lib']
16
-
17
- spec.add_dependency 'fix-expect', '~> 0.3.0'
18
- spec.add_dependency 'fix-its', '~> 0.4.0'
19
- spec.add_dependency 'matchi-rspec', '~> 0.0.2'
20
-
21
- spec.add_development_dependency 'bundler', '~> 1.10'
22
- spec.add_development_dependency 'rake', '~> 10.4'
23
- spec.add_development_dependency 'yard', '~> 0.8'
24
- spec.add_development_dependency 'simplecov', '~> 0.10'
25
- spec.add_development_dependency 'rubocop', '~> 0.34'
26
- spec.add_development_dependency 'spectus', '~> 3.0'
27
-
28
- spec.cert_chain = ['certs/gem-cyril-public_cert.pem']
29
- private_key = File.expand_path('~/.ssh/gem-cyril-private_key.pem')
30
- spec.signing_key = private_key if File.exist?(private_key)
31
- end
metadata.gz.sig DELETED
Binary file