appmap 0.83.2 → 0.83.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +16 -0
- data/CHANGELOG.md +21 -0
- data/appmap.gemspec +2 -1
- data/lib/appmap/hook/method/ruby2.rb +7 -3
- data/lib/appmap/hook/method/ruby3.rb +7 -3
- data/lib/appmap/version.rb +1 -1
- metadata +3 -356
- data/spec/class_map_spec.rb +0 -28
- data/spec/config_spec.rb +0 -155
- data/spec/depends/api_spec.rb +0 -196
- data/spec/depends/spec_helper.rb +0 -18
- data/spec/display_string_spec.rb +0 -40
- data/spec/fixtures/config/incomplete_config.yml +0 -1
- data/spec/fixtures/config/invalid_config.yml +0 -2
- data/spec/fixtures/config/invalid_yaml_config.yml +0 -3
- data/spec/fixtures/config/maximal_config.yml +0 -14
- data/spec/fixtures/config/missing_path_or_gem.yml +0 -3
- data/spec/fixtures/config/valid_config.yml +0 -3
- data/spec/fixtures/database.yml +0 -11
- data/spec/fixtures/depends/.gitignore +0 -2
- data/spec/fixtures/depends/app/controllers/api/api_keys_controller.rb +0 -2
- data/spec/fixtures/depends/app/controllers/organizations_controller.rb +0 -2
- data/spec/fixtures/depends/app/models/api_key.rb +0 -2
- data/spec/fixtures/depends/app/models/configuration.rb +0 -2
- data/spec/fixtures/depends/app/models/show.rb +0 -2
- data/spec/fixtures/depends/app/models/user.rb +0 -2
- data/spec/fixtures/depends/revoke_api_key.appmap.json +0 -901
- data/spec/fixtures/depends/spec/actual_rspec_test.rb +0 -7
- data/spec/fixtures/depends/spec/api_spec.rb +0 -2
- data/spec/fixtures/depends/spec/user_spec.rb +0 -2
- data/spec/fixtures/depends/test/actual_minitest_test.rb +0 -5
- data/spec/fixtures/depends/user_page_scenario.appmap.json +0 -1776
- data/spec/fixtures/hook/.gitignore +0 -2
- data/spec/fixtures/hook/app/controllers/api/api_keys_controller.rb +0 -1
- data/spec/fixtures/hook/app/controllers/organizations_controller.rb +0 -1
- data/spec/fixtures/hook/app/models/api_key.rb +0 -1
- data/spec/fixtures/hook/app/models/configuration.rb +0 -1
- data/spec/fixtures/hook/app/models/show.rb +0 -1
- data/spec/fixtures/hook/app/models/user.rb +0 -1
- data/spec/fixtures/hook/attr_accessor.rb +0 -5
- data/spec/fixtures/hook/compare.rb +0 -7
- data/spec/fixtures/hook/constructor.rb +0 -7
- data/spec/fixtures/hook/custom_instance_method.rb +0 -11
- data/spec/fixtures/hook/exception_method.rb +0 -61
- data/spec/fixtures/hook/exclude.rb +0 -15
- data/spec/fixtures/hook/instance_method.rb +0 -31
- data/spec/fixtures/hook/kwargs.rb +0 -11
- data/spec/fixtures/hook/labels.rb +0 -6
- data/spec/fixtures/hook/method_named_call.rb +0 -11
- data/spec/fixtures/hook/pkg_a/a.rb +0 -7
- data/spec/fixtures/hook/prepended_override.rb +0 -14
- data/spec/fixtures/hook/protected_method.rb +0 -29
- data/spec/fixtures/hook/report_parameters.rb +0 -8
- data/spec/fixtures/hook/revoke_api_key.appmap.json +0 -847
- data/spec/fixtures/hook/singleton_method.rb +0 -63
- data/spec/fixtures/hook/spec/api_spec.rb +0 -1
- data/spec/fixtures/hook/spec/user_spec.rb +0 -1
- data/spec/fixtures/hook/sub_packages.rb +0 -7
- data/spec/fixtures/hook/user_page_scenario.appmap.json +0 -1722
- data/spec/fixtures/rack_users_app/.dockerignore +0 -2
- data/spec/fixtures/rack_users_app/.gitignore +0 -2
- data/spec/fixtures/rack_users_app/Gemfile +0 -10
- data/spec/fixtures/rack_users_app/appmap.yml +0 -3
- data/spec/fixtures/rack_users_app/config.ru +0 -2
- data/spec/fixtures/rack_users_app/lib/app.rb +0 -36
- data/spec/fixtures/rails5_users_app/.dockerignore +0 -1
- data/spec/fixtures/rails5_users_app/.gitignore +0 -39
- data/spec/fixtures/rails5_users_app/.rspec +0 -1
- data/spec/fixtures/rails5_users_app/.ruby-version +0 -1
- data/spec/fixtures/rails5_users_app/Gemfile +0 -54
- data/spec/fixtures/rails5_users_app/Rakefile +0 -6
- data/spec/fixtures/rails5_users_app/app/controllers/api/users_controller.rb +0 -29
- data/spec/fixtures/rails5_users_app/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/rails5_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails5_users_app/app/controllers/health_controller.rb +0 -5
- data/spec/fixtures/rails5_users_app/app/controllers/users_controller.rb +0 -21
- data/spec/fixtures/rails5_users_app/app/models/activerecord/user.rb +0 -18
- data/spec/fixtures/rails5_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails5_users_app/app/models/sequel/user.rb +0 -25
- data/spec/fixtures/rails5_users_app/app/views/layouts/application.html.haml +0 -7
- data/spec/fixtures/rails5_users_app/app/views/users/index.html.haml +0 -7
- data/spec/fixtures/rails5_users_app/appmap.yml +0 -11
- data/spec/fixtures/rails5_users_app/bin/appmap +0 -29
- data/spec/fixtures/rails5_users_app/bin/byebug +0 -29
- data/spec/fixtures/rails5_users_app/bin/gli +0 -29
- data/spec/fixtures/rails5_users_app/bin/htmldiff +0 -29
- data/spec/fixtures/rails5_users_app/bin/ldiff +0 -29
- data/spec/fixtures/rails5_users_app/bin/nokogiri +0 -29
- data/spec/fixtures/rails5_users_app/bin/rackup +0 -29
- data/spec/fixtures/rails5_users_app/bin/rails +0 -4
- data/spec/fixtures/rails5_users_app/bin/rake +0 -29
- data/spec/fixtures/rails5_users_app/bin/rspec +0 -29
- data/spec/fixtures/rails5_users_app/bin/ruby-parse +0 -29
- data/spec/fixtures/rails5_users_app/bin/ruby-rewrite +0 -29
- data/spec/fixtures/rails5_users_app/bin/sequel +0 -29
- data/spec/fixtures/rails5_users_app/bin/setup +0 -25
- data/spec/fixtures/rails5_users_app/bin/sprockets +0 -29
- data/spec/fixtures/rails5_users_app/bin/thor +0 -29
- data/spec/fixtures/rails5_users_app/bin/update +0 -25
- data/spec/fixtures/rails5_users_app/config/application.rb +0 -45
- data/spec/fixtures/rails5_users_app/config/boot.rb +0 -3
- data/spec/fixtures/rails5_users_app/config/credentials.yml.enc +0 -1
- data/spec/fixtures/rails5_users_app/config/database.yml +0 -1
- data/spec/fixtures/rails5_users_app/config/environment.rb +0 -5
- data/spec/fixtures/rails5_users_app/config/environments/development.rb +0 -40
- data/spec/fixtures/rails5_users_app/config/environments/production.rb +0 -68
- data/spec/fixtures/rails5_users_app/config/environments/test.rb +0 -39
- data/spec/fixtures/rails5_users_app/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/fixtures/rails5_users_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/fixtures/rails5_users_app/config/initializers/cors.rb +0 -16
- data/spec/fixtures/rails5_users_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/fixtures/rails5_users_app/config/initializers/inflections.rb +0 -16
- data/spec/fixtures/rails5_users_app/config/initializers/mime_types.rb +0 -4
- data/spec/fixtures/rails5_users_app/config/initializers/wrap_parameters.rb +0 -9
- data/spec/fixtures/rails5_users_app/config/locales/en.yml +0 -33
- data/spec/fixtures/rails5_users_app/config/routes.rb +0 -11
- data/spec/fixtures/rails5_users_app/config.ru +0 -5
- data/spec/fixtures/rails5_users_app/db/migrate/20190728211408_create_users.rb +0 -9
- data/spec/fixtures/rails5_users_app/db/schema.rb +0 -23
- data/spec/fixtures/rails5_users_app/features/api_users.feature +0 -13
- data/spec/fixtures/rails5_users_app/features/support/env.rb +0 -4
- data/spec/fixtures/rails5_users_app/features/support/hooks.rb +0 -11
- data/spec/fixtures/rails5_users_app/features/support/steps.rb +0 -18
- data/spec/fixtures/rails5_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails5_users_app/log/.keep +0 -0
- data/spec/fixtures/rails5_users_app/public/robots.txt +0 -1
- data/spec/fixtures/rails5_users_app/spec/controllers/users_controller_api_spec.rb +0 -42
- data/spec/fixtures/rails5_users_app/spec/controllers/users_controller_spec.rb +0 -27
- data/spec/fixtures/rails5_users_app/spec/models/user_spec.rb +0 -29
- data/spec/fixtures/rails5_users_app/spec/rails_helper.rb +0 -57
- data/spec/fixtures/rails5_users_app/spec/spec_helper.rb +0 -96
- data/spec/fixtures/rails5_users_app/users_app/.gitignore +0 -20
- data/spec/fixtures/rails6_users_app/.dockerignore +0 -1
- data/spec/fixtures/rails6_users_app/.gitignore +0 -39
- data/spec/fixtures/rails6_users_app/.rspec +0 -1
- data/spec/fixtures/rails6_users_app/Gemfile +0 -28
- data/spec/fixtures/rails6_users_app/Rakefile +0 -6
- data/spec/fixtures/rails6_users_app/app/controllers/api/users_controller.rb +0 -28
- data/spec/fixtures/rails6_users_app/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/rails6_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails6_users_app/app/controllers/health_controller.rb +0 -5
- data/spec/fixtures/rails6_users_app/app/controllers/users_controller.rb +0 -21
- data/spec/fixtures/rails6_users_app/app/models/activerecord/user.rb +0 -18
- data/spec/fixtures/rails6_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails6_users_app/app/models/sequel/user.rb +0 -25
- data/spec/fixtures/rails6_users_app/app/views/layouts/application.html.haml +0 -7
- data/spec/fixtures/rails6_users_app/app/views/users/index.html.haml +0 -7
- data/spec/fixtures/rails6_users_app/appmap.yml +0 -14
- data/spec/fixtures/rails6_users_app/bin/appmap +0 -29
- data/spec/fixtures/rails6_users_app/bin/byebug +0 -29
- data/spec/fixtures/rails6_users_app/bin/gli +0 -29
- data/spec/fixtures/rails6_users_app/bin/htmldiff +0 -29
- data/spec/fixtures/rails6_users_app/bin/ldiff +0 -29
- data/spec/fixtures/rails6_users_app/bin/nokogiri +0 -29
- data/spec/fixtures/rails6_users_app/bin/rackup +0 -29
- data/spec/fixtures/rails6_users_app/bin/rails +0 -4
- data/spec/fixtures/rails6_users_app/bin/rake +0 -29
- data/spec/fixtures/rails6_users_app/bin/rspec +0 -29
- data/spec/fixtures/rails6_users_app/bin/ruby-parse +0 -29
- data/spec/fixtures/rails6_users_app/bin/ruby-rewrite +0 -29
- data/spec/fixtures/rails6_users_app/bin/sequel +0 -29
- data/spec/fixtures/rails6_users_app/bin/setup +0 -25
- data/spec/fixtures/rails6_users_app/bin/sprockets +0 -29
- data/spec/fixtures/rails6_users_app/bin/thor +0 -29
- data/spec/fixtures/rails6_users_app/bin/update +0 -25
- data/spec/fixtures/rails6_users_app/config/application.rb +0 -45
- data/spec/fixtures/rails6_users_app/config/boot.rb +0 -3
- data/spec/fixtures/rails6_users_app/config/credentials.yml.enc +0 -1
- data/spec/fixtures/rails6_users_app/config/database.yml +0 -1
- data/spec/fixtures/rails6_users_app/config/environment.rb +0 -5
- data/spec/fixtures/rails6_users_app/config/environments/development.rb +0 -40
- data/spec/fixtures/rails6_users_app/config/environments/production.rb +0 -68
- data/spec/fixtures/rails6_users_app/config/environments/test.rb +0 -39
- data/spec/fixtures/rails6_users_app/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/fixtures/rails6_users_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/fixtures/rails6_users_app/config/initializers/cors.rb +0 -16
- data/spec/fixtures/rails6_users_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/fixtures/rails6_users_app/config/initializers/inflections.rb +0 -16
- data/spec/fixtures/rails6_users_app/config/initializers/mime_types.rb +0 -4
- data/spec/fixtures/rails6_users_app/config/initializers/wrap_parameters.rb +0 -9
- data/spec/fixtures/rails6_users_app/config/locales/en.yml +0 -33
- data/spec/fixtures/rails6_users_app/config/routes.rb +0 -11
- data/spec/fixtures/rails6_users_app/config.ru +0 -5
- data/spec/fixtures/rails6_users_app/db/migrate/20190728211408_create_users.rb +0 -9
- data/spec/fixtures/rails6_users_app/db/schema.rb +0 -23
- data/spec/fixtures/rails6_users_app/features/api_users.feature +0 -13
- data/spec/fixtures/rails6_users_app/features/support/env.rb +0 -4
- data/spec/fixtures/rails6_users_app/features/support/hooks.rb +0 -11
- data/spec/fixtures/rails6_users_app/features/support/steps.rb +0 -18
- data/spec/fixtures/rails6_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails6_users_app/lib/tasks/appmap.rake +0 -23
- data/spec/fixtures/rails6_users_app/log/.keep +0 -0
- data/spec/fixtures/rails6_users_app/package.json +0 -8
- data/spec/fixtures/rails6_users_app/public/robots.txt +0 -1
- data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_api_spec.rb +0 -42
- data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_spec.rb +0 -27
- data/spec/fixtures/rails6_users_app/spec/models/user_spec.rb +0 -29
- data/spec/fixtures/rails6_users_app/spec/rails_helper.rb +0 -57
- data/spec/fixtures/rails6_users_app/spec/spec_helper.rb +0 -96
- data/spec/fixtures/rails6_users_app/test/controllers/functional_calc_test.rb +0 -10
- data/spec/fixtures/rails6_users_app/test/integration/integration_calc_test.rb +0 -12
- data/spec/fixtures/rails6_users_app/users_app/.gitignore +0 -20
- data/spec/fixtures/rails6_users_app/yarn.lock +0 -2020
- data/spec/fixtures/rails7_users_app/.dockerignore +0 -1
- data/spec/fixtures/rails7_users_app/.gitattributes +0 -7
- data/spec/fixtures/rails7_users_app/.gitignore +0 -31
- data/spec/fixtures/rails7_users_app/.rspec +0 -1
- data/spec/fixtures/rails7_users_app/Gemfile +0 -75
- data/spec/fixtures/rails7_users_app/README.md +0 -24
- data/spec/fixtures/rails7_users_app/Rakefile +0 -6
- data/spec/fixtures/rails7_users_app/app/assets/config/manifest.js +0 -4
- data/spec/fixtures/rails7_users_app/app/assets/images/.keep +0 -0
- data/spec/fixtures/rails7_users_app/app/assets/stylesheets/application.css +0 -15
- data/spec/fixtures/rails7_users_app/app/channels/application_cable/channel.rb +0 -4
- data/spec/fixtures/rails7_users_app/app/channels/application_cable/connection.rb +0 -4
- data/spec/fixtures/rails7_users_app/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/rails7_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails7_users_app/app/helpers/application_helper.rb +0 -2
- data/spec/fixtures/rails7_users_app/app/javascript/application.js +0 -3
- data/spec/fixtures/rails7_users_app/app/javascript/controllers/application.js +0 -9
- data/spec/fixtures/rails7_users_app/app/javascript/controllers/hello_controller.js +0 -7
- data/spec/fixtures/rails7_users_app/app/javascript/controllers/index.js +0 -11
- data/spec/fixtures/rails7_users_app/app/jobs/application_job.rb +0 -7
- data/spec/fixtures/rails7_users_app/app/mailers/application_mailer.rb +0 -4
- data/spec/fixtures/rails7_users_app/app/models/application_record.rb +0 -3
- data/spec/fixtures/rails7_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails7_users_app/app/models/instance.rb +0 -7
- data/spec/fixtures/rails7_users_app/app/models/instructor.rb +0 -7
- data/spec/fixtures/rails7_users_app/app/views/layouts/application.html.erb +0 -16
- data/spec/fixtures/rails7_users_app/app/views/layouts/mailer.html.erb +0 -13
- data/spec/fixtures/rails7_users_app/app/views/layouts/mailer.text.erb +0 -1
- data/spec/fixtures/rails7_users_app/appmap.yml +0 -3
- data/spec/fixtures/rails7_users_app/bin/bundle +0 -114
- data/spec/fixtures/rails7_users_app/bin/importmap +0 -4
- data/spec/fixtures/rails7_users_app/bin/rails +0 -4
- data/spec/fixtures/rails7_users_app/bin/rake +0 -4
- data/spec/fixtures/rails7_users_app/bin/setup +0 -33
- data/spec/fixtures/rails7_users_app/config/application.rb +0 -22
- data/spec/fixtures/rails7_users_app/config/boot.rb +0 -4
- data/spec/fixtures/rails7_users_app/config/cable.yml +0 -10
- data/spec/fixtures/rails7_users_app/config/credentials.yml.enc +0 -1
- data/spec/fixtures/rails7_users_app/config/database.yml +0 -1
- data/spec/fixtures/rails7_users_app/config/environment.rb +0 -5
- data/spec/fixtures/rails7_users_app/config/environments/development.rb +0 -70
- data/spec/fixtures/rails7_users_app/config/environments/production.rb +0 -93
- data/spec/fixtures/rails7_users_app/config/environments/test.rb +0 -60
- data/spec/fixtures/rails7_users_app/config/importmap.rb +0 -7
- data/spec/fixtures/rails7_users_app/config/initializers/assets.rb +0 -12
- data/spec/fixtures/rails7_users_app/config/initializers/content_security_policy.rb +0 -26
- data/spec/fixtures/rails7_users_app/config/initializers/filter_parameter_logging.rb +0 -8
- data/spec/fixtures/rails7_users_app/config/initializers/inflections.rb +0 -16
- data/spec/fixtures/rails7_users_app/config/initializers/permissions_policy.rb +0 -11
- data/spec/fixtures/rails7_users_app/config/locales/en.yml +0 -33
- data/spec/fixtures/rails7_users_app/config/puma.rb +0 -43
- data/spec/fixtures/rails7_users_app/config/routes.rb +0 -6
- data/spec/fixtures/rails7_users_app/config/storage.yml +0 -34
- data/spec/fixtures/rails7_users_app/config.ru +0 -6
- data/spec/fixtures/rails7_users_app/db/migrate/20220328093141_create_instances.rb +0 -8
- data/spec/fixtures/rails7_users_app/db/migrate/20220328093154_create_instructors.rb +0 -8
- data/spec/fixtures/rails7_users_app/db/schema.rb +0 -27
- data/spec/fixtures/rails7_users_app/db/seeds.rb +0 -7
- data/spec/fixtures/rails7_users_app/lib/assets/.keep +0 -0
- data/spec/fixtures/rails7_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails7_users_app/log/.keep +0 -0
- data/spec/fixtures/rails7_users_app/public/404.html +0 -67
- data/spec/fixtures/rails7_users_app/public/422.html +0 -67
- data/spec/fixtures/rails7_users_app/public/500.html +0 -66
- data/spec/fixtures/rails7_users_app/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/fixtures/rails7_users_app/public/apple-touch-icon.png +0 -0
- data/spec/fixtures/rails7_users_app/public/favicon.ico +0 -0
- data/spec/fixtures/rails7_users_app/public/robots.txt +0 -1
- data/spec/fixtures/rails7_users_app/storage/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/application_system_test_case.rb +0 -5
- data/spec/fixtures/rails7_users_app/test/channels/application_cable/connection_test.rb +0 -11
- data/spec/fixtures/rails7_users_app/test/controllers/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/fixtures/files/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/fixtures/instances.yml +0 -11
- data/spec/fixtures/rails7_users_app/test/fixtures/instructors.yml +0 -11
- data/spec/fixtures/rails7_users_app/test/helpers/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/integration/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/mailers/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/models/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/models/instance_test.rb +0 -6
- data/spec/fixtures/rails7_users_app/test/models/instructor_test.rb +0 -7
- data/spec/fixtures/rails7_users_app/test/system/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/test_helper.rb +0 -13
- data/spec/handler/eval_spec.rb +0 -66
- data/spec/hook_spec.rb +0 -1216
- data/spec/open_spec.rb +0 -19
- data/spec/rails_recording_spec.rb +0 -281
- data/spec/rails_spec_helper.rb +0 -107
- data/spec/rails_test_spec.rb +0 -35
- data/spec/railtie_spec.rb +0 -25
- data/spec/record_net_http_spec.rb +0 -161
- data/spec/record_sql_rails_pg_spec.rb +0 -59
- data/spec/remote_recording_spec.rb +0 -108
- data/spec/service/config_analyzer_spec.rb +0 -102
- data/spec/service/integration_test_path_finder_spec.rb +0 -24
- data/spec/service/validator/violation_spec.rb +0 -68
- data/spec/spec_helper.rb +0 -37
- data/spec/swagger/swagger_spec.rb +0 -85
- data/spec/util_spec.rb +0 -38
- data/test/agent_setup_init_test.rb +0 -39
- data/test/agent_setup_status_test.rb +0 -84
- data/test/agent_setup_validate_test.rb +0 -102
- data/test/bundle_vendor_test.rb +0 -35
- data/test/cucumber_test.rb +0 -72
- data/test/expectations/openssl_test_key_sign1.json +0 -53
- data/test/expectations/openssl_test_key_sign2-3.1.json +0 -53
- data/test/expectations/openssl_test_key_sign2.json +0 -58
- data/test/fixtures/bundle_vendor_app/Gemfile +0 -8
- data/test/fixtures/bundle_vendor_app/appmap.yml +0 -4
- data/test/fixtures/bundle_vendor_app/cli.rb +0 -54
- data/test/fixtures/cli_record_test/appmap.yml +0 -3
- data/test/fixtures/cli_record_test/lib/cli_record_test/main.rb +0 -9
- data/test/fixtures/cucumber4_recorder/Gemfile +0 -5
- data/test/fixtures/cucumber4_recorder/appmap.yml +0 -3
- data/test/fixtures/cucumber4_recorder/features/say_hello.feature +0 -5
- data/test/fixtures/cucumber4_recorder/features/support/env.rb +0 -5
- data/test/fixtures/cucumber4_recorder/features/support/hooks.rb +0 -11
- data/test/fixtures/cucumber4_recorder/features/support/steps.rb +0 -9
- data/test/fixtures/cucumber4_recorder/lib/hello.rb +0 -7
- data/test/fixtures/cucumber_recorder/Gemfile +0 -5
- data/test/fixtures/cucumber_recorder/appmap.yml +0 -3
- data/test/fixtures/cucumber_recorder/features/say_hello.feature +0 -5
- data/test/fixtures/cucumber_recorder/features/support/env.rb +0 -5
- data/test/fixtures/cucumber_recorder/features/support/hooks.rb +0 -11
- data/test/fixtures/cucumber_recorder/features/support/steps.rb +0 -9
- data/test/fixtures/cucumber_recorder/lib/hello.rb +0 -7
- data/test/fixtures/gem_test/Gemfile +0 -7
- data/test/fixtures/gem_test/appmap.yml +0 -3
- data/test/fixtures/gem_test/test/parser_test.rb +0 -12
- data/test/fixtures/minitest_recorder/Gemfile +0 -5
- data/test/fixtures/minitest_recorder/appmap.yml +0 -3
- data/test/fixtures/minitest_recorder/lib/hello.rb +0 -5
- data/test/fixtures/minitest_recorder/test/hello_test.rb +0 -12
- data/test/fixtures/mocha_mock_app/Gemfile +0 -5
- data/test/fixtures/mocha_mock_app/appmap.yml +0 -5
- data/test/fixtures/mocha_mock_app/lib/sheep.rb +0 -5
- data/test/fixtures/mocha_mock_app/test/sheep_test.rb +0 -18
- data/test/fixtures/openssl_recorder/Gemfile +0 -3
- data/test/fixtures/openssl_recorder/appmap.yml +0 -3
- data/test/fixtures/openssl_recorder/lib/openssl_cert_sign.rb +0 -94
- data/test/fixtures/openssl_recorder/lib/openssl_encrypt.rb +0 -34
- data/test/fixtures/openssl_recorder/lib/openssl_key_sign.rb +0 -28
- data/test/fixtures/process_recorder/appmap.yml +0 -3
- data/test/fixtures/process_recorder/hello.rb +0 -9
- data/test/fixtures/rspec_recorder/Gemfile +0 -5
- data/test/fixtures/rspec_recorder/appmap.yml +0 -3
- data/test/fixtures/rspec_recorder/lib/hello.rb +0 -5
- data/test/fixtures/rspec_recorder/spec/decorated_hello_spec.rb +0 -21
- data/test/fixtures/rspec_recorder/spec/labeled_hello_spec.rb +0 -9
- data/test/fixtures/rspec_recorder/spec/plain_hello_spec.rb +0 -9
- data/test/gem_test.rb +0 -35
- data/test/inspect_cli_test.rb +0 -12
- data/test/minitest_test.rb +0 -37
- data/test/mock_compatibility_test.rb +0 -45
- data/test/openssl_test.rb +0 -54
- data/test/record_process_test.rb +0 -35
- data/test/rspec_test.rb +0 -63
- data/test/test_helper.rb +0 -8
@@ -1,94 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# From the manual page https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL.html
|
4
|
-
|
5
|
-
require 'openssl'
|
6
|
-
|
7
|
-
module Example
|
8
|
-
def Example.sign
|
9
|
-
ca_key = OpenSSL::PKey::RSA.new 2048
|
10
|
-
pass_phrase = 'my secure pass phrase goes here'
|
11
|
-
|
12
|
-
cipher = OpenSSL::Cipher.new 'AES-256-CBC'
|
13
|
-
|
14
|
-
open 'tmp/ca_key.pem', 'w', 0644 do |io|
|
15
|
-
io.write ca_key.export(cipher, pass_phrase)
|
16
|
-
end
|
17
|
-
|
18
|
-
ca_name = OpenSSL::X509::Name.parse '/CN=ca/DC=example'
|
19
|
-
|
20
|
-
ca_cert = OpenSSL::X509::Certificate.new
|
21
|
-
ca_cert.serial = 0
|
22
|
-
ca_cert.version = 2
|
23
|
-
ca_cert.not_before = Time.now
|
24
|
-
ca_cert.not_after = Time.now + 86400
|
25
|
-
|
26
|
-
ca_cert.public_key = ca_key.public_key
|
27
|
-
ca_cert.subject = ca_name
|
28
|
-
ca_cert.issuer = ca_name
|
29
|
-
|
30
|
-
extension_factory = OpenSSL::X509::ExtensionFactory.new
|
31
|
-
extension_factory.subject_certificate = ca_cert
|
32
|
-
extension_factory.issuer_certificate = ca_cert
|
33
|
-
|
34
|
-
ca_cert.add_extension extension_factory.create_extension('subjectKeyIdentifier', 'hash')
|
35
|
-
ca_cert.add_extension extension_factory.create_extension('basicConstraints', 'CA:TRUE', true)
|
36
|
-
|
37
|
-
ca_cert.add_extension extension_factory.create_extension(
|
38
|
-
'keyUsage', 'cRLSign,keyCertSign', true)
|
39
|
-
|
40
|
-
ca_cert.sign ca_key, OpenSSL::Digest::SHA1.new
|
41
|
-
|
42
|
-
open 'tmp/ca_cert.pem', 'w' do |io|
|
43
|
-
io.write ca_cert.to_pem
|
44
|
-
end
|
45
|
-
|
46
|
-
csr = OpenSSL::X509::Request.new
|
47
|
-
csr.version = 0
|
48
|
-
csr.subject = OpenSSL::X509::Name.new([ ['CN', 'the name to sign', OpenSSL::ASN1::UTF8STRING] ])
|
49
|
-
csr.public_key = ca_key.public_key
|
50
|
-
csr.sign ca_key, OpenSSL::Digest::SHA1.new
|
51
|
-
|
52
|
-
open 'tmp/csr.pem', 'w' do |io|
|
53
|
-
io.write csr.to_pem
|
54
|
-
end
|
55
|
-
|
56
|
-
csr = OpenSSL::X509::Request.new File.read 'tmp/csr.pem'
|
57
|
-
|
58
|
-
raise 'CSR can not be verified' unless csr.verify csr.public_key
|
59
|
-
|
60
|
-
csr_cert = OpenSSL::X509::Certificate.new
|
61
|
-
csr_cert.serial = 0
|
62
|
-
csr_cert.version = 2
|
63
|
-
csr_cert.not_before = Time.now
|
64
|
-
csr_cert.not_after = Time.now + 600
|
65
|
-
|
66
|
-
csr_cert.subject = csr.subject
|
67
|
-
csr_cert.public_key = csr.public_key
|
68
|
-
csr_cert.issuer = ca_cert.subject
|
69
|
-
|
70
|
-
extension_factory = OpenSSL::X509::ExtensionFactory.new
|
71
|
-
extension_factory.subject_certificate = csr_cert
|
72
|
-
extension_factory.issuer_certificate = ca_cert
|
73
|
-
|
74
|
-
csr_cert.add_extension extension_factory.create_extension('basicConstraints', 'CA:FALSE')
|
75
|
-
|
76
|
-
csr_cert.add_extension extension_factory.create_extension(
|
77
|
-
'keyUsage', 'keyEncipherment,dataEncipherment,digitalSignature')
|
78
|
-
|
79
|
-
csr_cert.add_extension extension_factory.create_extension('subjectKeyIdentifier', 'hash')
|
80
|
-
|
81
|
-
csr_cert.sign ca_key, OpenSSL::Digest::SHA1.new
|
82
|
-
|
83
|
-
'tmp/csr_cert.pem'.tap do |fname|
|
84
|
-
open fname, 'w' do |io|
|
85
|
-
io.write csr_cert.to_pem
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
if __FILE__ == $0
|
92
|
-
cert_file = Example.sign
|
93
|
-
puts "Wrote cert file #{cert_file}"
|
94
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# From the manual page https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL.html
|
4
|
-
|
5
|
-
require 'openssl'
|
6
|
-
|
7
|
-
module Example
|
8
|
-
def Example.encrypt
|
9
|
-
cipher = OpenSSL::Cipher.new 'AES-256-CBC'
|
10
|
-
cipher.encrypt
|
11
|
-
iv = cipher.random_iv
|
12
|
-
|
13
|
-
pwd = 'some hopefully not to easily guessable password'
|
14
|
-
salt = OpenSSL::Random.random_bytes 16
|
15
|
-
iter = 20000
|
16
|
-
key_len = cipher.key_len
|
17
|
-
digest = OpenSSL::Digest::SHA256.new
|
18
|
-
|
19
|
-
key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
|
20
|
-
cipher.key = key
|
21
|
-
|
22
|
-
document = 'the document'
|
23
|
-
|
24
|
-
encrypted = cipher.update document
|
25
|
-
encrypted << cipher.final
|
26
|
-
encrypted
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
if __FILE__ == $0
|
31
|
-
ciphertext = Example.encrypt
|
32
|
-
require 'base64'
|
33
|
-
puts "Computed ciphertext #{Base64.urlsafe_encode64(ciphertext)}"
|
34
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# From the manual page https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL.html
|
4
|
-
|
5
|
-
require 'appmap'
|
6
|
-
require 'openssl'
|
7
|
-
require 'openssl/digest'
|
8
|
-
|
9
|
-
module Example
|
10
|
-
def Example.sign
|
11
|
-
key = OpenSSL::PKey::RSA.new 2048
|
12
|
-
|
13
|
-
document = 'the document'
|
14
|
-
|
15
|
-
digest = OpenSSL::Digest::SHA256.new
|
16
|
-
key.sign digest, document
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
if __FILE__ == $0
|
21
|
-
appmap = AppMap.record do
|
22
|
-
Example.sign
|
23
|
-
puts 'Computed signature'
|
24
|
-
end
|
25
|
-
appmap['metadata'] = [ 'recorder' => __FILE__ ]
|
26
|
-
|
27
|
-
File.write('appmap.json', JSON.generate(appmap))
|
28
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'appmap/rspec'
|
3
|
-
require 'hello'
|
4
|
-
|
5
|
-
describe Hello do
|
6
|
-
before do
|
7
|
-
# Trick appmap-ruby into thinking we're a Rails app.
|
8
|
-
stub_const('Rails', double('rails', version: 'fake.0'))
|
9
|
-
end
|
10
|
-
|
11
|
-
# The order of these examples is important. The tests check the
|
12
|
-
# appmap for 'says hello', and we want another example to get run
|
13
|
-
# before it.
|
14
|
-
it 'does not say goodbye' do
|
15
|
-
expect(Hello.new.say_hello).not_to eq('Goodbye!')
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'says hello' do
|
19
|
-
expect(Hello.new.say_hello).to eq('Hello!')
|
20
|
-
end
|
21
|
-
end
|
data/test/gem_test.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
require 'English'
|
6
|
-
require 'json'
|
7
|
-
|
8
|
-
class GemTest < Minitest::Test
|
9
|
-
def perform_gem_test(test_name)
|
10
|
-
Bundler.with_clean_env do
|
11
|
-
Dir.chdir 'test/fixtures/gem_test' do
|
12
|
-
FileUtils.rm_rf 'tmp'
|
13
|
-
system 'bundle config --local local.appmap ../../..'
|
14
|
-
system 'bundle'
|
15
|
-
system({ 'APPMAP' => 'true' }, %(bundle exec ruby -Ilib -Itest test/#{test_name}_test.rb))
|
16
|
-
|
17
|
-
yield
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_record_gem
|
23
|
-
perform_gem_test 'parser' do
|
24
|
-
appmap_file = 'tmp/appmap/minitest/Parser_parser.appmap.json'
|
25
|
-
appmap = JSON.parse(File.read(appmap_file))
|
26
|
-
events = appmap['events']
|
27
|
-
assert_equal 6, events.size
|
28
|
-
assert_equal 'call', events.first['event']
|
29
|
-
assert_equal 'default_parser', events.first['method_id']
|
30
|
-
assert_match /\lib\/parser\/base\.rb$/, events.first['path']
|
31
|
-
assert_equal 'return', events.second['event']
|
32
|
-
assert_equal 1, events.second['parent_id']
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/test/inspect_cli_test.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
|
6
|
-
class InspectCLITest < Minitest::Test
|
7
|
-
def test_help
|
8
|
-
output = `./exe/appmap-inspect --help`
|
9
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
10
|
-
assert_includes output, 'Search AppMaps for references to a code object'
|
11
|
-
end
|
12
|
-
end
|
data/test/minitest_test.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
require 'English'
|
6
|
-
|
7
|
-
class MinitestTest < Minitest::Test
|
8
|
-
def perform_minitest_test(test_name)
|
9
|
-
Bundler.with_clean_env do
|
10
|
-
Dir.chdir 'test/fixtures/minitest_recorder' do
|
11
|
-
FileUtils.rm_rf 'tmp'
|
12
|
-
system 'bundle config --local local.appmap ../../..'
|
13
|
-
system 'bundle'
|
14
|
-
system({ 'APPMAP' => 'true' }, %(bundle exec ruby -Ilib -Itest test/#{test_name}_test.rb))
|
15
|
-
|
16
|
-
yield
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_hello
|
22
|
-
perform_minitest_test 'hello' do
|
23
|
-
appmap_file = 'tmp/appmap/minitest/Hello_hello.appmap.json'
|
24
|
-
|
25
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
26
|
-
appmap = JSON.parse(File.read(appmap_file))
|
27
|
-
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
28
|
-
assert_includes appmap.keys, 'metadata'
|
29
|
-
metadata = appmap['metadata']
|
30
|
-
assert_equal 'minitest_recorder', metadata['app']
|
31
|
-
assert_equal 'minitest', metadata['recorder']['name']
|
32
|
-
assert_equal 'ruby', metadata['language']['name']
|
33
|
-
assert_equal 'Hello hello', metadata['name']
|
34
|
-
assert_equal 'test/hello_test.rb:9', metadata['source_location']
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
|
6
|
-
class MockCompatibilityTest < Minitest::Test
|
7
|
-
def perform_minitest_test(test_name, env = {})
|
8
|
-
Bundler.with_clean_env do
|
9
|
-
Dir.chdir 'test/fixtures/mocha_mock_app' do
|
10
|
-
FileUtils.rm_rf 'tmp'
|
11
|
-
system 'bundle config --local local.appmap ../../..'
|
12
|
-
system 'bundle'
|
13
|
-
system(env.merge({ 'APPMAP' => 'true' }), %(bundle exec ruby -Ilib -Itest test/#{test_name}_test.rb))
|
14
|
-
|
15
|
-
yield
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_expectation
|
21
|
-
perform_minitest_test('sheep') do
|
22
|
-
appmap_file = 'tmp/appmap/minitest/Sheep_sheep.appmap.json'
|
23
|
-
|
24
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
25
|
-
appmap = JSON.parse(File.read(appmap_file))
|
26
|
-
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
27
|
-
assert_includes appmap.keys, 'metadata'
|
28
|
-
metadata = appmap['metadata']
|
29
|
-
assert_equal 'succeeded', metadata['test_status']
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_expectation_without_autorequire
|
34
|
-
perform_minitest_test('sheep', 'APPMAP_AUTOREQUIRE' => 'false') do
|
35
|
-
appmap_file = 'tmp/appmap/minitest/Sheep_sheep.appmap.json'
|
36
|
-
|
37
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
38
|
-
appmap = JSON.parse(File.read(appmap_file))
|
39
|
-
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
40
|
-
assert_includes appmap.keys, 'metadata'
|
41
|
-
metadata = appmap['metadata']
|
42
|
-
assert_equal 'succeeded', metadata['test_status']
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/test/openssl_test.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
require 'English'
|
6
|
-
|
7
|
-
class OpenSSLTest < Minitest::Test
|
8
|
-
def perform_test(test_name)
|
9
|
-
Bundler.with_clean_env do
|
10
|
-
Dir.chdir 'test/fixtures/openssl_recorder' do
|
11
|
-
FileUtils.rm_rf 'tmp'
|
12
|
-
system 'bundle config --local local.appmap ../../..'
|
13
|
-
system 'bundle'
|
14
|
-
system({ 'APPMAP' => 'true' }, %(bundle exec ruby lib/openssl_#{test_name}.rb))
|
15
|
-
|
16
|
-
yield
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def expectation(name)
|
22
|
-
File.read File.join __dir__, 'expectations', name
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_key_sign
|
26
|
-
perform_test 'key_sign' do
|
27
|
-
appmap_file = 'appmap.json'
|
28
|
-
|
29
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
30
|
-
appmap = JSON.parse(File.read(appmap_file))
|
31
|
-
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
32
|
-
assert_equal [ { 'recorder' => 'lib/openssl_key_sign.rb' } ], appmap['metadata']
|
33
|
-
assert_equal JSON.parse(expectation('openssl_test_key_sign1.json')), appmap['classMap']
|
34
|
-
sanitized_events = appmap['events'].map(&:deep_symbolize_keys).map(&AppMap::Util.method(:sanitize_event)).map do |event|
|
35
|
-
delete_value = ->(obj) { (obj || {}).delete(:value) }
|
36
|
-
delete_value.call(event[:receiver])
|
37
|
-
delete_value.call(event[:return_value])
|
38
|
-
event
|
39
|
-
end
|
40
|
-
|
41
|
-
# Signature of OpenSSL::PKey::PKey.sign changed in 3.1
|
42
|
-
expected = if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1')
|
43
|
-
expectation('openssl_test_key_sign2-3.1.json').strip
|
44
|
-
else
|
45
|
-
expectation('openssl_test_key_sign2.json').strip
|
46
|
-
end
|
47
|
-
diff = Diffy::Diff.new(
|
48
|
-
expected,
|
49
|
-
JSON.pretty_generate(sanitized_events).strip
|
50
|
-
)
|
51
|
-
assert_equal '', diff.to_s
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
data/test/record_process_test.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
require 'English'
|
6
|
-
|
7
|
-
class RecordProcessTest < Minitest::Test
|
8
|
-
def perform_test(program_name)
|
9
|
-
Bundler.with_clean_env do
|
10
|
-
Dir.chdir 'test/fixtures/process_recorder' do
|
11
|
-
FileUtils.rm_rf 'tmp'
|
12
|
-
system 'bundle config --local local.appmap ../../..'
|
13
|
-
system 'bundle'
|
14
|
-
system(%(bundle exec ruby #{program_name}))
|
15
|
-
|
16
|
-
yield
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_hello
|
22
|
-
perform_test 'hello.rb' do
|
23
|
-
appmap_file = 'appmap.json'
|
24
|
-
|
25
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
26
|
-
appmap = JSON.parse(File.read(appmap_file))
|
27
|
-
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
28
|
-
assert_includes appmap.keys, 'metadata'
|
29
|
-
metadata = appmap['metadata']
|
30
|
-
assert_equal 'process_recorder', metadata['app']
|
31
|
-
assert_equal 'record_process', metadata['recorder']['name']
|
32
|
-
assert_equal 'ruby', metadata['language']['name']
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/test/rspec_test.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
require 'English'
|
6
|
-
|
7
|
-
class RSpecTest < Minitest::Test
|
8
|
-
def perform_test(test_name)
|
9
|
-
Bundler.with_clean_env do
|
10
|
-
Dir.chdir 'test/fixtures/rspec_recorder' do
|
11
|
-
FileUtils.rm_rf 'tmp'
|
12
|
-
system 'bundle config --local local.appmap ../../..'
|
13
|
-
system 'bundle'
|
14
|
-
system({ 'APPMAP' => 'true' }, %(bundle exec rspec spec/#{test_name}.rb))
|
15
|
-
|
16
|
-
yield
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_record_decorated_rspec
|
22
|
-
perform_test 'decorated_hello_spec' do
|
23
|
-
appmap_file = 'tmp/appmap/rspec/Hello_says_hello.appmap.json'
|
24
|
-
|
25
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
26
|
-
appmap = JSON.parse(File.read(appmap_file))
|
27
|
-
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
28
|
-
assert_includes appmap.keys, 'metadata'
|
29
|
-
metadata = appmap['metadata']
|
30
|
-
assert_equal 'Hello says hello', metadata['name']
|
31
|
-
assert_equal 'spec/decorated_hello_spec.rb', metadata['source_location']
|
32
|
-
assert_includes metadata.keys, 'client'
|
33
|
-
assert_equal({ name: 'appmap', url: AppMap::URL, version: AppMap::VERSION }.stringify_keys, metadata['client'])
|
34
|
-
assert_includes metadata.keys, 'recorder'
|
35
|
-
assert_equal({ name: 'rspec' }.stringify_keys, metadata['recorder'])
|
36
|
-
|
37
|
-
assert_includes metadata.keys, 'frameworks'
|
38
|
-
rspec = metadata['frameworks'].select {|f| f['name'] == 'rspec'}
|
39
|
-
assert_equal 1, rspec.count
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_record_plain_rspec
|
44
|
-
perform_test 'plain_hello_spec' do
|
45
|
-
appmap_file = 'tmp/appmap/rspec/Hello_says_hello.appmap.json'
|
46
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
47
|
-
appmap = JSON.parse(File.read(appmap_file))
|
48
|
-
assert_includes appmap.keys, 'metadata'
|
49
|
-
metadata = appmap['metadata']
|
50
|
-
assert_equal 'Hello says hello', metadata['name']
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_record_labeled_rspec
|
55
|
-
perform_test 'labeled_hello_spec' do
|
56
|
-
appmap_file = 'tmp/appmap/rspec/Hello_says_hello.appmap.json'
|
57
|
-
assert File.file?(appmap_file), 'appmap output file does not exist'
|
58
|
-
appmap = JSON.parse(File.read(appmap_file))
|
59
|
-
assert_includes appmap.keys, 'metadata'
|
60
|
-
metadata = appmap['metadata']
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|