From 68dcd76d58584c192f202409365350d0b356e391 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Mon, 13 Nov 2017 17:00:02 -0500 Subject: Fix separator so it doesn't mutate user data --- test/options_test.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/options_test.rb b/test/options_test.rb index bb19210..8553fe1 100644 --- a/test/options_test.rb +++ b/test/options_test.rb @@ -36,6 +36,15 @@ describe Slop::Options do end end + describe "#separator" do + # TODO: Missing all other specs for #separator + + it "accepts a frozen argument, even when called multiple times for the same option" do + @options.separator("foo".freeze) + @options.separator("bar".freeze) + end + end + describe "#method_missing" do it "uses the method name as an option type" do option = @options.string("--name") @@ -86,7 +95,7 @@ describe Slop::Options do describe "custom banner" do it "is prefixed with defined banner" do @options_config = Slop::Options.new({banner: "custom banner"}) - assert_match(/^custom banner/, @options_config.to_s) + assert_match(/^custom banner/, @options_config.to_s) end it "banner is disabled" do @options_config = Slop::Options.new({banner: false}) -- cgit v1.2.1