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=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_YAHOO_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no 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 649741F4BD for ; Thu, 3 Oct 2019 21:54:17 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0C6F2120A8C; Fri, 4 Oct 2019 06:54:08 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 7EC8D120977 for ; Fri, 4 Oct 2019 06:54:05 +0900 (JST) Received: by filter0150p3mdw1.sendgrid.net with SMTP id filter0150p3mdw1-30058-5D966DFD-3A 2019-10-03 21:54:05.530414502 +0000 UTC m=+12732.982845486 Received: from herokuapp.com (unknown [54.81.242.65]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id IRHjaws4SNy7Tl_wK-xa-A for ; Thu, 03 Oct 2019 21:54:05.534 +0000 (UTC) Date: Thu, 03 Oct 2019 21:54:05 +0000 (UTC) From: burdettelamar@yahoo.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70795 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16235 X-Redmine-Issue-Author: burdettelamar@yahoo.com X-Redmine-Sender: burdettelamar@yahoo.com 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?M0WX68AHQr=2FVSnvsB1Qo5xEo9+xKABJC=2FqJZ83MVt=2FqI2x=2Fm9BdQOM+h1r=2Ff5c?= =?us-ascii?Q?pfPEgep0mrM0YAVQcOBa1ddkzN2FKnlJ3=2FIR9LN?= =?us-ascii?Q?fwouifPFNF=2F05zZcfFXS9ntoqNhUfwyAICyMRqE?= =?us-ascii?Q?33w7nkx+fEmggBxgEj70xK1gkrb6MYcuukEMMbo?= =?us-ascii?Q?mNkik3SvTkLs7r7KpZ=2FA71KgUI5YOYWO1mQ=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95208 Subject: [ruby-core:95208] [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 burdettelamar@yahoo.com (Burdette Lamar). Method :reserve_names fails if any name is already in use: ``` def reserve_names(*names) @reserved = names @reserved.each do |name| fail "Name #{name} is already in use" if ENV.include?(name) end end ``` So, not a problem? ---------------------------------------- Misc #16235: ENV.assoc spec test does not test invalid name https://bugs.ruby-lang.org/issues/16235#change-81882 * 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/