crspec 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/crspec/version.rb +1 -1
- metadata +1 -156
- data/benchmark/README.md +0 -56
- data/benchmark/run.rb +0 -72
- data/benchmark/spec/user_service_crspec_spec.rb +0 -15
- data/benchmark/spec/user_service_rspec_spec.rb +0 -16
- data/benchmark/target_service.rb +0 -12
- data/benchmark/test/user_service_test.rb +0 -18
- data/demo.rb +0 -129
- data/samples/book_store/.dockerignore +0 -51
- data/samples/book_store/.gitattributes +0 -9
- data/samples/book_store/.github/dependabot.yml +0 -12
- data/samples/book_store/.github/workflows/ci.yml +0 -130
- data/samples/book_store/.gitignore +0 -35
- data/samples/book_store/.kamal/hooks/docker-setup.sample +0 -3
- data/samples/book_store/.kamal/hooks/post-app-boot.sample +0 -3
- data/samples/book_store/.kamal/hooks/post-deploy.sample +0 -14
- data/samples/book_store/.kamal/hooks/post-proxy-reboot.sample +0 -3
- data/samples/book_store/.kamal/hooks/pre-app-boot.sample +0 -3
- data/samples/book_store/.kamal/hooks/pre-build.sample +0 -51
- data/samples/book_store/.kamal/hooks/pre-connect.sample +0 -47
- data/samples/book_store/.kamal/hooks/pre-deploy.sample +0 -122
- data/samples/book_store/.kamal/hooks/pre-proxy-reboot.sample +0 -3
- data/samples/book_store/.kamal/secrets +0 -20
- data/samples/book_store/.rubocop.yml +0 -8
- data/samples/book_store/.ruby-version +0 -1
- data/samples/book_store/Dockerfile +0 -77
- data/samples/book_store/Gemfile +0 -67
- data/samples/book_store/Gemfile.lock +0 -572
- data/samples/book_store/README.md +0 -24
- data/samples/book_store/Rakefile +0 -6
- data/samples/book_store/app/assets/images/.keep +0 -0
- data/samples/book_store/app/assets/stylesheets/application.css +0 -10
- data/samples/book_store/app/controllers/application_controller.rb +0 -2
- data/samples/book_store/app/controllers/books_controller.rb +0 -30
- data/samples/book_store/app/controllers/comments_controller.rb +0 -21
- data/samples/book_store/app/controllers/concerns/.keep +0 -0
- data/samples/book_store/app/controllers/users_controller.rb +0 -21
- data/samples/book_store/app/helpers/application_helper.rb +0 -2
- data/samples/book_store/app/helpers/books_helper.rb +0 -2
- data/samples/book_store/app/helpers/comments_helper.rb +0 -2
- data/samples/book_store/app/helpers/users_helper.rb +0 -2
- data/samples/book_store/app/javascript/application.js +0 -3
- data/samples/book_store/app/javascript/controllers/application.js +0 -9
- data/samples/book_store/app/javascript/controllers/hello_controller.js +0 -7
- data/samples/book_store/app/javascript/controllers/index.js +0 -4
- data/samples/book_store/app/jobs/application_job.rb +0 -7
- data/samples/book_store/app/mailers/application_mailer.rb +0 -4
- data/samples/book_store/app/models/application_record.rb +0 -3
- data/samples/book_store/app/models/book.rb +0 -10
- data/samples/book_store/app/models/comment.rb +0 -6
- data/samples/book_store/app/models/concerns/.keep +0 -0
- data/samples/book_store/app/models/user.rb +0 -4
- data/samples/book_store/app/views/layouts/application.html.erb +0 -29
- data/samples/book_store/app/views/layouts/mailer.html.erb +0 -13
- data/samples/book_store/app/views/layouts/mailer.text.erb +0 -1
- data/samples/book_store/app/views/pwa/manifest.json.erb +0 -22
- data/samples/book_store/app/views/pwa/service-worker.js +0 -26
- data/samples/book_store/bin/brakeman +0 -7
- data/samples/book_store/bin/bundler-audit +0 -6
- data/samples/book_store/bin/ci +0 -6
- data/samples/book_store/bin/dev +0 -2
- data/samples/book_store/bin/docker-entrypoint +0 -8
- data/samples/book_store/bin/importmap +0 -4
- data/samples/book_store/bin/jobs +0 -6
- data/samples/book_store/bin/kamal +0 -16
- data/samples/book_store/bin/rails +0 -4
- data/samples/book_store/bin/rake +0 -4
- data/samples/book_store/bin/rubocop +0 -8
- data/samples/book_store/bin/setup +0 -35
- data/samples/book_store/bin/thrust +0 -5
- data/samples/book_store/config/application.rb +0 -27
- data/samples/book_store/config/boot.rb +0 -4
- data/samples/book_store/config/bundler-audit.yml +0 -5
- data/samples/book_store/config/cable.yml +0 -17
- data/samples/book_store/config/cache.yml +0 -16
- data/samples/book_store/config/ci.rb +0 -24
- data/samples/book_store/config/credentials.yml.enc +0 -1
- data/samples/book_store/config/database.yml +0 -45
- data/samples/book_store/config/deploy.yml +0 -119
- data/samples/book_store/config/environment.rb +0 -5
- data/samples/book_store/config/environments/development.rb +0 -78
- data/samples/book_store/config/environments/production.rb +0 -90
- data/samples/book_store/config/environments/test.rb +0 -53
- data/samples/book_store/config/importmap.rb +0 -7
- data/samples/book_store/config/initializers/assets.rb +0 -7
- data/samples/book_store/config/initializers/content_security_policy.rb +0 -29
- data/samples/book_store/config/initializers/filter_parameter_logging.rb +0 -8
- data/samples/book_store/config/initializers/inflections.rb +0 -16
- data/samples/book_store/config/locales/en.yml +0 -31
- data/samples/book_store/config/puma.rb +0 -42
- data/samples/book_store/config/queue.yml +0 -18
- data/samples/book_store/config/recurring.yml +0 -15
- data/samples/book_store/config/routes.rb +0 -17
- data/samples/book_store/config/storage.yml +0 -27
- data/samples/book_store/config.ru +0 -6
- data/samples/book_store/db/cable_schema.rb +0 -11
- data/samples/book_store/db/cache_schema.rb +0 -12
- data/samples/book_store/db/migrate/20260731035441_create_users.rb +0 -10
- data/samples/book_store/db/migrate/20260731035506_create_books.rb +0 -11
- data/samples/book_store/db/migrate/20260731035528_create_comments.rb +0 -11
- data/samples/book_store/db/queue_schema.rb +0 -129
- data/samples/book_store/db/schema.rb +0 -39
- data/samples/book_store/db/seeds.rb +0 -9
- data/samples/book_store/lib/tasks/.keep +0 -0
- data/samples/book_store/log/.keep +0 -0
- data/samples/book_store/public/400.html +0 -135
- data/samples/book_store/public/404.html +0 -135
- data/samples/book_store/public/406-unsupported-browser.html +0 -135
- data/samples/book_store/public/422.html +0 -135
- data/samples/book_store/public/500.html +0 -135
- data/samples/book_store/public/icon.png +0 -0
- data/samples/book_store/public/icon.svg +0 -3
- data/samples/book_store/public/robots.txt +0 -1
- data/samples/book_store/script/.keep +0 -0
- data/samples/book_store/spec/models/book_spec.rb +0 -42
- data/samples/book_store/spec/models/comment_spec.rb +0 -22
- data/samples/book_store/spec/models/user_advanced_spec.rb +0 -27
- data/samples/book_store/spec/models/user_spec.rb +0 -30
- data/samples/book_store/spec/rails_helper.rb +0 -36
- data/samples/book_store/spec/rails_parallel_spec.rb +0 -23
- data/samples/book_store/spec/requests/books_spec.rb +0 -21
- data/samples/book_store/spec/requests/users_spec.rb +0 -14
- data/samples/book_store/spec/services/inventory_service_spec.rb +0 -28
- data/samples/book_store/spec/services/time_dependent_service_spec.rb +0 -26
- data/samples/book_store/spec/spec_helper.rb +0 -16
- data/samples/book_store/spec/system/book_store_system_spec.rb +0 -18
- data/samples/book_store/storage/.keep +0 -0
- data/samples/book_store/test/controllers/.keep +0 -0
- data/samples/book_store/test/controllers/books_controller_test.rb +0 -7
- data/samples/book_store/test/controllers/comments_controller_test.rb +0 -7
- data/samples/book_store/test/controllers/users_controller_test.rb +0 -7
- data/samples/book_store/test/fixtures/books.yml +0 -11
- data/samples/book_store/test/fixtures/comments.yml +0 -11
- data/samples/book_store/test/fixtures/files/.keep +0 -0
- data/samples/book_store/test/fixtures/users.yml +0 -9
- data/samples/book_store/test/helpers/.keep +0 -0
- data/samples/book_store/test/integration/.keep +0 -0
- data/samples/book_store/test/mailers/.keep +0 -0
- data/samples/book_store/test/models/.keep +0 -0
- data/samples/book_store/test/models/book_test.rb +0 -7
- data/samples/book_store/test/models/comment_test.rb +0 -7
- data/samples/book_store/test/models/user_test.rb +0 -7
- data/samples/book_store/test/test_helper.rb +0 -15
- data/samples/book_store/tmp/.keep +0 -0
- data/samples/book_store/tmp/pids/.keep +0 -0
- data/samples/book_store/tmp/storage/.keep +0 -0
- data/samples/book_store/vendor/.keep +0 -0
- data/samples/book_store/vendor/javascript/.keep +0 -0
- data/samples/user_spec.rb +0 -31
- data/test/crspec/configuration_test.rb +0 -76
- data/test/crspec/execution_context_test.rb +0 -61
- data/test/crspec/mock_test.rb +0 -55
- data/test/crspec/rails_test.rb +0 -62
- data/test/crspec/runner_test.rb +0 -68
- data/test/crspec/transpiler_test.rb +0 -41
- data/test/test_helper.rb +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e70183d3b574744a0de1061ba25f99d495bdbaa4d9940cb76f76d37124701328
|
|
4
|
+
data.tar.gz: 02f551a7420e923ae7fd5f6357ee6c55256600adac922f6adeab7b3e811cae65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9abb32f9cbb3411ce1de2ab806395e5629c42802f83b1cc6f346f164d87c6c487ceea69a64c6650f2a2f2267436eedf06c30b64ba4313c4b757f9bb803bf901
|
|
7
|
+
data.tar.gz: b29fba9882c81d8bae86250693e764ed49c17cba74d180e05536e522bc6bf5d9f0faf293340937b39d1a7bf88a4b65a9fe7e617d635749f144548ad7598fe49b
|
data/lib/crspec/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aboobacker MK
|
|
@@ -38,13 +38,6 @@ files:
|
|
|
38
38
|
- LICENSE.txt
|
|
39
39
|
- README.md
|
|
40
40
|
- Rakefile
|
|
41
|
-
- benchmark/README.md
|
|
42
|
-
- benchmark/run.rb
|
|
43
|
-
- benchmark/spec/user_service_crspec_spec.rb
|
|
44
|
-
- benchmark/spec/user_service_rspec_spec.rb
|
|
45
|
-
- benchmark/target_service.rb
|
|
46
|
-
- benchmark/test/user_service_test.rb
|
|
47
|
-
- demo.rb
|
|
48
41
|
- exe/crspec
|
|
49
42
|
- exe/crspec-transpile
|
|
50
43
|
- lib/crspec.rb
|
|
@@ -69,155 +62,7 @@ files:
|
|
|
69
62
|
- lib/crspec/transpiler/cli.rb
|
|
70
63
|
- lib/crspec/transpiler/rewriter.rb
|
|
71
64
|
- lib/crspec/version.rb
|
|
72
|
-
- samples/book_store/.dockerignore
|
|
73
|
-
- samples/book_store/.gitattributes
|
|
74
|
-
- samples/book_store/.github/dependabot.yml
|
|
75
|
-
- samples/book_store/.github/workflows/ci.yml
|
|
76
|
-
- samples/book_store/.gitignore
|
|
77
|
-
- samples/book_store/.kamal/hooks/docker-setup.sample
|
|
78
|
-
- samples/book_store/.kamal/hooks/post-app-boot.sample
|
|
79
|
-
- samples/book_store/.kamal/hooks/post-deploy.sample
|
|
80
|
-
- samples/book_store/.kamal/hooks/post-proxy-reboot.sample
|
|
81
|
-
- samples/book_store/.kamal/hooks/pre-app-boot.sample
|
|
82
|
-
- samples/book_store/.kamal/hooks/pre-build.sample
|
|
83
|
-
- samples/book_store/.kamal/hooks/pre-connect.sample
|
|
84
|
-
- samples/book_store/.kamal/hooks/pre-deploy.sample
|
|
85
|
-
- samples/book_store/.kamal/hooks/pre-proxy-reboot.sample
|
|
86
|
-
- samples/book_store/.kamal/secrets
|
|
87
|
-
- samples/book_store/.rubocop.yml
|
|
88
|
-
- samples/book_store/.ruby-version
|
|
89
|
-
- samples/book_store/Dockerfile
|
|
90
|
-
- samples/book_store/Gemfile
|
|
91
|
-
- samples/book_store/Gemfile.lock
|
|
92
|
-
- samples/book_store/README.md
|
|
93
|
-
- samples/book_store/Rakefile
|
|
94
|
-
- samples/book_store/app/assets/images/.keep
|
|
95
|
-
- samples/book_store/app/assets/stylesheets/application.css
|
|
96
|
-
- samples/book_store/app/controllers/application_controller.rb
|
|
97
|
-
- samples/book_store/app/controllers/books_controller.rb
|
|
98
|
-
- samples/book_store/app/controllers/comments_controller.rb
|
|
99
|
-
- samples/book_store/app/controllers/concerns/.keep
|
|
100
|
-
- samples/book_store/app/controllers/users_controller.rb
|
|
101
|
-
- samples/book_store/app/helpers/application_helper.rb
|
|
102
|
-
- samples/book_store/app/helpers/books_helper.rb
|
|
103
|
-
- samples/book_store/app/helpers/comments_helper.rb
|
|
104
|
-
- samples/book_store/app/helpers/users_helper.rb
|
|
105
|
-
- samples/book_store/app/javascript/application.js
|
|
106
|
-
- samples/book_store/app/javascript/controllers/application.js
|
|
107
|
-
- samples/book_store/app/javascript/controllers/hello_controller.js
|
|
108
|
-
- samples/book_store/app/javascript/controllers/index.js
|
|
109
|
-
- samples/book_store/app/jobs/application_job.rb
|
|
110
|
-
- samples/book_store/app/mailers/application_mailer.rb
|
|
111
|
-
- samples/book_store/app/models/application_record.rb
|
|
112
|
-
- samples/book_store/app/models/book.rb
|
|
113
|
-
- samples/book_store/app/models/comment.rb
|
|
114
|
-
- samples/book_store/app/models/concerns/.keep
|
|
115
|
-
- samples/book_store/app/models/user.rb
|
|
116
|
-
- samples/book_store/app/views/layouts/application.html.erb
|
|
117
|
-
- samples/book_store/app/views/layouts/mailer.html.erb
|
|
118
|
-
- samples/book_store/app/views/layouts/mailer.text.erb
|
|
119
|
-
- samples/book_store/app/views/pwa/manifest.json.erb
|
|
120
|
-
- samples/book_store/app/views/pwa/service-worker.js
|
|
121
|
-
- samples/book_store/bin/brakeman
|
|
122
|
-
- samples/book_store/bin/bundler-audit
|
|
123
|
-
- samples/book_store/bin/ci
|
|
124
|
-
- samples/book_store/bin/dev
|
|
125
|
-
- samples/book_store/bin/docker-entrypoint
|
|
126
|
-
- samples/book_store/bin/importmap
|
|
127
|
-
- samples/book_store/bin/jobs
|
|
128
|
-
- samples/book_store/bin/kamal
|
|
129
|
-
- samples/book_store/bin/rails
|
|
130
|
-
- samples/book_store/bin/rake
|
|
131
|
-
- samples/book_store/bin/rubocop
|
|
132
|
-
- samples/book_store/bin/setup
|
|
133
|
-
- samples/book_store/bin/thrust
|
|
134
|
-
- samples/book_store/config.ru
|
|
135
|
-
- samples/book_store/config/application.rb
|
|
136
|
-
- samples/book_store/config/boot.rb
|
|
137
|
-
- samples/book_store/config/bundler-audit.yml
|
|
138
|
-
- samples/book_store/config/cable.yml
|
|
139
|
-
- samples/book_store/config/cache.yml
|
|
140
|
-
- samples/book_store/config/ci.rb
|
|
141
|
-
- samples/book_store/config/credentials.yml.enc
|
|
142
|
-
- samples/book_store/config/database.yml
|
|
143
|
-
- samples/book_store/config/deploy.yml
|
|
144
|
-
- samples/book_store/config/environment.rb
|
|
145
|
-
- samples/book_store/config/environments/development.rb
|
|
146
|
-
- samples/book_store/config/environments/production.rb
|
|
147
|
-
- samples/book_store/config/environments/test.rb
|
|
148
|
-
- samples/book_store/config/importmap.rb
|
|
149
|
-
- samples/book_store/config/initializers/assets.rb
|
|
150
|
-
- samples/book_store/config/initializers/content_security_policy.rb
|
|
151
|
-
- samples/book_store/config/initializers/filter_parameter_logging.rb
|
|
152
|
-
- samples/book_store/config/initializers/inflections.rb
|
|
153
|
-
- samples/book_store/config/locales/en.yml
|
|
154
|
-
- samples/book_store/config/puma.rb
|
|
155
|
-
- samples/book_store/config/queue.yml
|
|
156
|
-
- samples/book_store/config/recurring.yml
|
|
157
|
-
- samples/book_store/config/routes.rb
|
|
158
|
-
- samples/book_store/config/storage.yml
|
|
159
|
-
- samples/book_store/db/cable_schema.rb
|
|
160
|
-
- samples/book_store/db/cache_schema.rb
|
|
161
|
-
- samples/book_store/db/migrate/20260731035441_create_users.rb
|
|
162
|
-
- samples/book_store/db/migrate/20260731035506_create_books.rb
|
|
163
|
-
- samples/book_store/db/migrate/20260731035528_create_comments.rb
|
|
164
|
-
- samples/book_store/db/queue_schema.rb
|
|
165
|
-
- samples/book_store/db/schema.rb
|
|
166
|
-
- samples/book_store/db/seeds.rb
|
|
167
|
-
- samples/book_store/lib/tasks/.keep
|
|
168
|
-
- samples/book_store/log/.keep
|
|
169
|
-
- samples/book_store/public/400.html
|
|
170
|
-
- samples/book_store/public/404.html
|
|
171
|
-
- samples/book_store/public/406-unsupported-browser.html
|
|
172
|
-
- samples/book_store/public/422.html
|
|
173
|
-
- samples/book_store/public/500.html
|
|
174
|
-
- samples/book_store/public/icon.png
|
|
175
|
-
- samples/book_store/public/icon.svg
|
|
176
|
-
- samples/book_store/public/robots.txt
|
|
177
|
-
- samples/book_store/script/.keep
|
|
178
|
-
- samples/book_store/spec/models/book_spec.rb
|
|
179
|
-
- samples/book_store/spec/models/comment_spec.rb
|
|
180
|
-
- samples/book_store/spec/models/user_advanced_spec.rb
|
|
181
|
-
- samples/book_store/spec/models/user_spec.rb
|
|
182
|
-
- samples/book_store/spec/rails_helper.rb
|
|
183
|
-
- samples/book_store/spec/rails_parallel_spec.rb
|
|
184
|
-
- samples/book_store/spec/requests/books_spec.rb
|
|
185
|
-
- samples/book_store/spec/requests/users_spec.rb
|
|
186
|
-
- samples/book_store/spec/services/inventory_service_spec.rb
|
|
187
|
-
- samples/book_store/spec/services/time_dependent_service_spec.rb
|
|
188
|
-
- samples/book_store/spec/spec_helper.rb
|
|
189
|
-
- samples/book_store/spec/system/book_store_system_spec.rb
|
|
190
|
-
- samples/book_store/storage/.keep
|
|
191
|
-
- samples/book_store/test/controllers/.keep
|
|
192
|
-
- samples/book_store/test/controllers/books_controller_test.rb
|
|
193
|
-
- samples/book_store/test/controllers/comments_controller_test.rb
|
|
194
|
-
- samples/book_store/test/controllers/users_controller_test.rb
|
|
195
|
-
- samples/book_store/test/fixtures/books.yml
|
|
196
|
-
- samples/book_store/test/fixtures/comments.yml
|
|
197
|
-
- samples/book_store/test/fixtures/files/.keep
|
|
198
|
-
- samples/book_store/test/fixtures/users.yml
|
|
199
|
-
- samples/book_store/test/helpers/.keep
|
|
200
|
-
- samples/book_store/test/integration/.keep
|
|
201
|
-
- samples/book_store/test/mailers/.keep
|
|
202
|
-
- samples/book_store/test/models/.keep
|
|
203
|
-
- samples/book_store/test/models/book_test.rb
|
|
204
|
-
- samples/book_store/test/models/comment_test.rb
|
|
205
|
-
- samples/book_store/test/models/user_test.rb
|
|
206
|
-
- samples/book_store/test/test_helper.rb
|
|
207
|
-
- samples/book_store/tmp/.keep
|
|
208
|
-
- samples/book_store/tmp/pids/.keep
|
|
209
|
-
- samples/book_store/tmp/storage/.keep
|
|
210
|
-
- samples/book_store/vendor/.keep
|
|
211
|
-
- samples/book_store/vendor/javascript/.keep
|
|
212
|
-
- samples/user_spec.rb
|
|
213
65
|
- sig/crspec.rbs
|
|
214
|
-
- test/crspec/configuration_test.rb
|
|
215
|
-
- test/crspec/execution_context_test.rb
|
|
216
|
-
- test/crspec/mock_test.rb
|
|
217
|
-
- test/crspec/rails_test.rb
|
|
218
|
-
- test/crspec/runner_test.rb
|
|
219
|
-
- test/crspec/transpiler_test.rb
|
|
220
|
-
- test/test_helper.rb
|
|
221
66
|
homepage: https://github.com/crspec/crspec
|
|
222
67
|
licenses:
|
|
223
68
|
- MIT
|
data/benchmark/README.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Crspec Native Benchmark Suite
|
|
2
|
-
|
|
3
|
-
This directory contains benchmarking utilities comparing default native framework runner performance across **crspec**, **RSpec**, and **Minitest** without any manual thread-slicing or concurrency controls in the benchmark script.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Directory Structure
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
benchmark/
|
|
11
|
-
├── target_service.rb # Domain target class under test (UserService)
|
|
12
|
-
├── spec/
|
|
13
|
-
│ ├── user_service_crspec_spec.rb # Idiomatic Crspec spec (Crspec.describe)
|
|
14
|
-
│ └── user_service_rspec_spec.rb # Idiomatic RSpec spec (RSpec.describe)
|
|
15
|
-
├── test/
|
|
16
|
-
│ └── user_service_test.rb # Idiomatic Minitest test (class UserServiceTest < Minitest::Test)
|
|
17
|
-
├── run.rb # Clean benchmark runner script
|
|
18
|
-
└── README.md
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Evaluated Configurations
|
|
24
|
-
|
|
25
|
-
Each framework is executed using its native default runner invocation:
|
|
26
|
-
- **Crspec (Native Default Runner)**: Uses `Crspec::Runner.new` default multi-threaded / fiber execution kernel.
|
|
27
|
-
- **RSpec (Native Default Runner)**: Native standard RSpec runner.
|
|
28
|
-
- **Minitest (Native Default Runner)**: Native Minitest runner.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## How to Run
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
mise exec -- ruby benchmark/run.rb
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Benchmark Results (macOS arm64 / Ruby 4.0.2)
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
==========================================================================
|
|
44
|
-
Crspec vs RSpec vs Minitest Benchmark Suite
|
|
45
|
-
Test Workload: 100 examples per framework
|
|
46
|
-
Evaluating Default Native Framework Runners (No Manual Concurrency Controls)
|
|
47
|
-
==========================================================================
|
|
48
|
-
|
|
49
|
-
Results Summary:
|
|
50
|
-
Framework Engine | Duration (s) | Throughput (ops/s)
|
|
51
|
-
------------------------------------------------------------------------------
|
|
52
|
-
Crspec (Native Default Runner) | 0.0211 | 4749.47
|
|
53
|
-
RSpec (Native Default Runner) | 0.1375 | 727.15
|
|
54
|
-
Minitest (Native Default Runner) | 0.1259 | 794.45
|
|
55
|
-
==============================================================================
|
|
56
|
-
```
|
data/benchmark/run.rb
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
|
4
|
-
$LOAD_PATH.unshift File.expand_path(__dir__)
|
|
5
|
-
|
|
6
|
-
require "crspec"
|
|
7
|
-
require "rspec/core"
|
|
8
|
-
require "minitest"
|
|
9
|
-
require "stringio"
|
|
10
|
-
|
|
11
|
-
NUMBER_OF_TESTS = 100
|
|
12
|
-
|
|
13
|
-
Rails.logger.debug "=========================================================================="
|
|
14
|
-
Rails.logger.debug " Crspec vs RSpec vs Minitest Benchmark Suite"
|
|
15
|
-
Rails.logger.debug { " Test Workload: #{NUMBER_OF_TESTS} examples per framework" }
|
|
16
|
-
Rails.logger.debug " Evaluating Default Native Framework Runners (No Manual Concurrency Controls)"
|
|
17
|
-
Rails.logger.debug "=========================================================================="
|
|
18
|
-
|
|
19
|
-
results = {}
|
|
20
|
-
null_formatter = Crspec::Formatters::NullFormatter.new
|
|
21
|
-
|
|
22
|
-
# -----------------------------------------------------------------------------
|
|
23
|
-
# 1. Crspec Native Execution (Default Concurrency Kernel)
|
|
24
|
-
# -----------------------------------------------------------------------------
|
|
25
|
-
Crspec.reset!
|
|
26
|
-
load File.expand_path("spec/user_service_crspec_spec.rb", __dir__)
|
|
27
|
-
|
|
28
|
-
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
29
|
-
Crspec::Runner.new(formatter: null_formatter).run(Crspec.world.example_groups)
|
|
30
|
-
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
31
|
-
results["Crspec (Native Default Runner)"] = t1 - t0
|
|
32
|
-
|
|
33
|
-
# -----------------------------------------------------------------------------
|
|
34
|
-
# 2. RSpec Native Execution
|
|
35
|
-
# -----------------------------------------------------------------------------
|
|
36
|
-
config = RSpec::Core::Configuration.new
|
|
37
|
-
config.output_stream = StringIO.new
|
|
38
|
-
world = RSpec::Core::World.new(config)
|
|
39
|
-
RSpec.instance_variable_set(:@world, world)
|
|
40
|
-
load File.expand_path("spec/user_service_rspec_spec.rb", __dir__)
|
|
41
|
-
|
|
42
|
-
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
43
|
-
world.example_groups.first.run(config.reporter)
|
|
44
|
-
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
45
|
-
results["RSpec (Native Default Runner)"] = t1 - t0
|
|
46
|
-
|
|
47
|
-
# -----------------------------------------------------------------------------
|
|
48
|
-
# 3. Minitest Native Execution
|
|
49
|
-
# -----------------------------------------------------------------------------
|
|
50
|
-
load File.expand_path("test/user_service_test.rb", __dir__)
|
|
51
|
-
|
|
52
|
-
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
53
|
-
Minitest::CompositeReporter.new
|
|
54
|
-
UserServiceTest.runnable_methods.each do |method_name|
|
|
55
|
-
UserServiceTest.new(method_name).run
|
|
56
|
-
end
|
|
57
|
-
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
58
|
-
results["Minitest (Native Default Runner)"] = t1 - t0
|
|
59
|
-
|
|
60
|
-
# -----------------------------------------------------------------------------
|
|
61
|
-
# Summary Output
|
|
62
|
-
# -----------------------------------------------------------------------------
|
|
63
|
-
Rails.logger.debug "\nResults Summary:"
|
|
64
|
-
Rails.logger.debug format("%-45s | %-12s | %-15s", "Framework Engine", "Duration (s)", "Throughput (ops/s)")
|
|
65
|
-
Rails.logger.debug "-" * 78
|
|
66
|
-
|
|
67
|
-
results.each do |engine, duration|
|
|
68
|
-
throughput = (NUMBER_OF_TESTS / duration).round(2)
|
|
69
|
-
Rails.logger.debug format("%-45s | %-12.4f | %-15.2f", engine, duration, throughput)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
Rails.logger.debug "=" * 78
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "../target_service"
|
|
4
|
-
|
|
5
|
-
Crspec.describe UserService do
|
|
6
|
-
100.times do |i|
|
|
7
|
-
let(:"user_#{i}") { UserService.process_user(i, "User #{i}", "user#{i}@example.com") }
|
|
8
|
-
|
|
9
|
-
it "processes user #{i}" do
|
|
10
|
-
u = send(:"user_#{i}")
|
|
11
|
-
expect(u[:valid]).to be(true)
|
|
12
|
-
expect(u[:token]).not_to be_nil
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "rspec/core"
|
|
4
|
-
require_relative "../target_service"
|
|
5
|
-
|
|
6
|
-
RSpec.describe UserService do
|
|
7
|
-
100.times do |i|
|
|
8
|
-
let(:"user_#{i}") { UserService.process_user(i, "User #{i}", "user#{i}@example.com") }
|
|
9
|
-
|
|
10
|
-
it "processes user #{i}" do
|
|
11
|
-
u = send(:"user_#{i}")
|
|
12
|
-
expect(u[:valid]).to be(true)
|
|
13
|
-
expect(u[:token]).not_to be_nil
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
data/benchmark/target_service.rb
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "digest"
|
|
4
|
-
|
|
5
|
-
class UserService
|
|
6
|
-
def self.process_user(id, name, email)
|
|
7
|
-
# Simulate non-blocking I/O query (e.g. database lease / HTTP call)
|
|
8
|
-
sleep 0.001
|
|
9
|
-
token = Digest::SHA256.hexdigest("#{id}-#{name}-#{email}")
|
|
10
|
-
{ id: id, name: name, email: email, token: token, valid: true }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "minitest"
|
|
4
|
-
require_relative "../target_service"
|
|
5
|
-
|
|
6
|
-
Minitest.seed ||= srand
|
|
7
|
-
|
|
8
|
-
class UserServiceTest < Minitest::Test
|
|
9
|
-
parallelize_me! if respond_to?(:parallelize_me!)
|
|
10
|
-
|
|
11
|
-
100.times do |i|
|
|
12
|
-
define_method(:"test_user_#{i}") do
|
|
13
|
-
u = UserService.process_user(i, "User #{i}", "user#{i}@example.com")
|
|
14
|
-
assert u[:valid]
|
|
15
|
-
refute_nil u[:token]
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
data/demo.rb
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/inline"
|
|
4
|
-
|
|
5
|
-
gemfile do
|
|
6
|
-
source "https://rubygems.org"
|
|
7
|
-
gem "crspec", path: __dir__
|
|
8
|
-
gem "prism"
|
|
9
|
-
gem "rails", "~> 8.0"
|
|
10
|
-
gem "sqlite3"
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
require "crspec"
|
|
14
|
-
require "rails"
|
|
15
|
-
|
|
16
|
-
puts "================================================================="
|
|
17
|
-
puts " Crspec Single-File Inline Demo & Feature Verification "
|
|
18
|
-
puts "================================================================="
|
|
19
|
-
|
|
20
|
-
# Reset global state for clean standalone run
|
|
21
|
-
Crspec.reset!
|
|
22
|
-
|
|
23
|
-
# Domain Models
|
|
24
|
-
class User
|
|
25
|
-
attr_accessor :name, :email
|
|
26
|
-
|
|
27
|
-
def initialize(name:, email:)
|
|
28
|
-
@name = name
|
|
29
|
-
@email = email
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def valid?
|
|
33
|
-
return false if name.nil? || email.nil?
|
|
34
|
-
|
|
35
|
-
email.include?("@")
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
class PaymentProcessor
|
|
40
|
-
def charge(amount)
|
|
41
|
-
"real_charge_#{amount}"
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# 1. Core DSL, Context Isolation, Lazy Let Memoization, Matchers
|
|
46
|
-
Crspec.describe User, type: :model do
|
|
47
|
-
let(:valid_attributes) { { name: "Jane Doe", email: "jane@example.com" } }
|
|
48
|
-
subject(:user) { User.new(**valid_attributes) }
|
|
49
|
-
|
|
50
|
-
before do
|
|
51
|
-
# Per-example setup hook
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
it "validates primary attributes concurrently" do
|
|
55
|
-
expect(user.valid?).to be(true)
|
|
56
|
-
expect(user.name).to eq("Jane Doe")
|
|
57
|
-
expect(user.email).to include("example.com")
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
context "when email is invalid" do
|
|
61
|
-
let(:valid_attributes) { { name: "Jane Doe", email: nil } }
|
|
62
|
-
|
|
63
|
-
it "flags validation errors" do
|
|
64
|
-
expect(user.valid?).to eq(false)
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
context "when error is expected" do
|
|
69
|
-
it "catches raised exceptions" do
|
|
70
|
-
expect { raise ArgumentError, "Invalid user input" }.to raise_error(ArgumentError, "Invalid user input")
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# 2. Fiber-Aware Mocking Engine (crspec-mock)
|
|
76
|
-
Crspec.describe PaymentProcessor do
|
|
77
|
-
let(:processor) { PaymentProcessor.new }
|
|
78
|
-
|
|
79
|
-
it "supports fiber-isolated method stubs" do
|
|
80
|
-
allow(processor).to receive(:charge).with(5000).and_return("succeeded")
|
|
81
|
-
expect(processor.charge(5000)).to eq("succeeded")
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
it "supports test doubles and method expectations" do
|
|
85
|
-
gateway_double = double("StripeGateway", process: "ok")
|
|
86
|
-
expect(gateway_double.process).to eq("ok")
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# 3. Rails Parallel Worker Integration (crspec-rails)
|
|
91
|
-
Crspec::Rails::Parallel.parallelize(workers: 4) do
|
|
92
|
-
parallelize_setup do |_worker_num|
|
|
93
|
-
# Per-worker setup hook
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
parallelize_teardown do |_worker_num|
|
|
97
|
-
# Per-worker teardown hook
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
# 4. Prism AST Transpiler Verification (crspec-transpiler)
|
|
102
|
-
rspec_sample_code = <<~RUBY
|
|
103
|
-
RSpec.describe "Legacy Suite" do
|
|
104
|
-
it "runs" do
|
|
105
|
-
expect(1).to eq(1)
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
RUBY
|
|
109
|
-
|
|
110
|
-
transpiled = Crspec::Transpiler::Rewriter.new(rspec_sample_code).transpile
|
|
111
|
-
puts "[Prism Transpiler Check] RSpec -> Crspec: #{transpiled.include?("Crspec.describe") ? "PASSED" : "FAILED"}"
|
|
112
|
-
|
|
113
|
-
# 5. Concurrent Multi-Threaded Execution Kernel
|
|
114
|
-
puts "\n[Executing Specs Concurrently Across 4 Worker Threads]..."
|
|
115
|
-
runner = Crspec::Runner.new(concurrency: 4)
|
|
116
|
-
runner.run(Crspec.world.example_groups)
|
|
117
|
-
|
|
118
|
-
puts "\n---------------- Execution Summary ----------------"
|
|
119
|
-
puts "Total Duration : #{runner.total_duration.round(4)}s"
|
|
120
|
-
puts "Passed Examples: #{runner.passed_examples.size}"
|
|
121
|
-
puts "Failed Examples: #{runner.failed_examples.size}"
|
|
122
|
-
puts "---------------------------------------------------"
|
|
123
|
-
|
|
124
|
-
if runner.success?
|
|
125
|
-
puts "\nSUCCESS: All specs executed concurrently across 4 worker threads and passed cleanly!"
|
|
126
|
-
else
|
|
127
|
-
puts "\nFAILURE: Some specs failed."
|
|
128
|
-
exit 1
|
|
129
|
-
end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# Ignore git directory.
|
|
4
|
-
/.git/
|
|
5
|
-
/.gitignore
|
|
6
|
-
|
|
7
|
-
# Ignore bundler config.
|
|
8
|
-
/.bundle
|
|
9
|
-
|
|
10
|
-
# Ignore all environment files.
|
|
11
|
-
/.env*
|
|
12
|
-
|
|
13
|
-
# Ignore all default key files.
|
|
14
|
-
/config/master.key
|
|
15
|
-
/config/credentials/*.key
|
|
16
|
-
|
|
17
|
-
# Ignore all logfiles and tempfiles.
|
|
18
|
-
/log/*
|
|
19
|
-
/tmp/*
|
|
20
|
-
!/log/.keep
|
|
21
|
-
!/tmp/.keep
|
|
22
|
-
|
|
23
|
-
# Ignore pidfiles, but keep the directory.
|
|
24
|
-
/tmp/pids/*
|
|
25
|
-
!/tmp/pids/.keep
|
|
26
|
-
|
|
27
|
-
# Ignore storage (uploaded files in development and any SQLite databases).
|
|
28
|
-
/storage/*
|
|
29
|
-
!/storage/.keep
|
|
30
|
-
/tmp/storage/*
|
|
31
|
-
!/tmp/storage/.keep
|
|
32
|
-
|
|
33
|
-
# Ignore assets.
|
|
34
|
-
/node_modules/
|
|
35
|
-
/app/assets/builds/*
|
|
36
|
-
!/app/assets/builds/.keep
|
|
37
|
-
/public/assets
|
|
38
|
-
|
|
39
|
-
# Ignore CI service files.
|
|
40
|
-
/.github
|
|
41
|
-
|
|
42
|
-
# Ignore Kamal files.
|
|
43
|
-
/config/deploy*.yml
|
|
44
|
-
/.kamal
|
|
45
|
-
|
|
46
|
-
# Ignore development files
|
|
47
|
-
/.devcontainer
|
|
48
|
-
|
|
49
|
-
# Ignore Docker-related files
|
|
50
|
-
/.dockerignore
|
|
51
|
-
/Dockerfile*
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
|
|
2
|
-
|
|
3
|
-
# Mark the database schema as having been generated.
|
|
4
|
-
db/schema.rb linguist-generated
|
|
5
|
-
|
|
6
|
-
# Mark any vendored files as having been vendored.
|
|
7
|
-
vendor/* linguist-vendored
|
|
8
|
-
config/credentials/*.yml.enc diff=rails_credentials
|
|
9
|
-
config/credentials.yml.enc diff=rails_credentials
|