From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id DDD031F4BD for ; Thu, 3 Oct 2019 21:31:52 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 112BC120A82; Fri, 4 Oct 2019 06:31:43 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5D2CA120A81 for ; Fri, 4 Oct 2019 06:31:38 +0900 (JST) Received: by filter0134p3las1.sendgrid.net with SMTP id filter0134p3las1-28241-5D9668BA-7 2019-10-03 21:31:38.114910534 +0000 UTC m=+10419.766602250 Received: from herokuapp.com (unknown [54.81.242.65]) by ismtpd0013p1iad2.sendgrid.net (SG) with ESMTP id -Z3GgxNdQsOpRrDxQFGz1g for ; Thu, 03 Oct 2019 21:31:38.003 +0000 (UTC) Date: Thu, 03 Oct 2019 21:31:38 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70794 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16235 X-Redmine-Issue-Author: burdettelamar@yahoo.com X-Redmine-Sender: jeremyevans0 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BI0EJDDrR=2FYpto=2FwqVb+Kpid4H=2FnOiJQSludJk1?= =?us-ascii?Q?qeaItWK7lQZakof6MLPGwq1hxIOcd+q0tqF+T1H?= =?us-ascii?Q?o=2FoudVrYylrd4soekHr3uFJNihbvN7aqqGKy5B+?= =?us-ascii?Q?OaUKAATE1uaaruZ6CD8SPdxUxeV=2FAHPPBeQ=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95207 Subject: [ruby-core:95207] [Ruby master Misc#16235] ENV.assoc spec test does not test invalid name X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16235 has been updated by jeremyevans0 (Jeremy Evans). It appears if `reserve_names` is called with a name that is already an environment variable, `release_names` will remove that name from the environment, which seems like a bug. Now, that issue exists in the current code (environment variable `foo` is always modified and removed. But if we are going to handle this, we should probably not set @reserved until after checking the names, and only remove the @reserved entries if the instance variable is defined. Note that since these changes are only to the specs, you may want to consider submitting them as pull requests to ruby/spec: https://github.com/ruby/spec/pulls ---------------------------------------- Misc #16235: ENV.assoc spec test does not test invalid name https://bugs.ruby-lang.org/issues/16235#change-81881 * Author: burdettelamar@yahoo.com (Burdette Lamar) * Status: Open * Priority: Normal * Assignee: ---------------------------------------- The most important thing here is an added test for an invalid name argument to ENV.assoc, which should raise TypeError. I've also added to spec_helper.rb: - Methods :reserve_names and :release_names, to reserve and release names used in the test. - Method :mock_to_str, to return a mock object that responds to :to_str. The updated assoc_spec.rb uses all of these, as will many other spec tests for ENV, as I get to them. It's known that some of the ENV spec tests do not test a method's return value, and that some do not test error conditions (as above), so more to come. All in good time. ---Files-------------------------------- t.diff (2.24 KB) -- https://bugs.ruby-lang.org/