@@ -2044,11 +2044,6 @@ def assert_accessing_setting_is_deprecated(settings, setting)
20442044 expect ( @settings . print_configs? ) . to be_falsey
20452045 end
20462046
2047- it "should return true when :configprint has a value" do
2048- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "something" )
2049- expect ( @settings . print_configs? ) . to be_truthy
2050- end
2051-
20522047 it "should return true when :genconfig has a value" do
20532048 allow ( @settings ) . to receive ( :value ) . with ( :genconfig ) . and_return ( true )
20542049 expect ( @settings . print_configs? ) . to be_truthy
@@ -2061,57 +2056,6 @@ def assert_accessing_setting_is_deprecated(settings, setting)
20612056 end
20622057
20632058 describe "when printing configs" do
2064- describe "when :configprint has a value" do
2065- it "should call print_config_options" do
2066- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "something" )
2067- expect ( @settings ) . to receive ( :print_config_options )
2068- @settings . print_configs
2069- end
2070-
2071- it "should get the value of the option using the environment" do
2072- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "something" )
2073- allow ( @settings ) . to receive ( :include? ) . with ( "something" ) . and_return ( true )
2074- expect ( @settings ) . to receive ( :value ) . with ( :environment ) . and_return ( "env" )
2075- expect ( @settings ) . to receive ( :value ) . with ( "something" , "env" ) . and_return ( "foo" )
2076- allow ( @settings ) . to receive ( :puts ) . with ( "foo" )
2077- @settings . print_configs
2078- end
2079-
2080- it "should print the value of the option" do
2081- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "something" )
2082- allow ( @settings ) . to receive ( :include? ) . with ( "something" ) . and_return ( true )
2083- allow ( @settings ) . to receive ( :value ) . with ( "something" , nil ) . and_return ( "foo" )
2084- expect ( @settings ) . to receive ( :puts ) . with ( "foo" )
2085- @settings . print_configs
2086- end
2087-
2088- it "should print the value pairs if there are multiple options" do
2089- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "bar,baz" )
2090- allow ( @settings ) . to receive ( :include? ) . with ( "bar" ) . and_return ( true )
2091- allow ( @settings ) . to receive ( :include? ) . with ( "baz" ) . and_return ( true )
2092- allow ( @settings ) . to receive ( :value ) . with ( "bar" , nil ) . and_return ( "foo" )
2093- allow ( @settings ) . to receive ( :value ) . with ( "baz" , nil ) . and_return ( "fud" )
2094- expect ( @settings ) . to receive ( :puts ) . with ( "bar = foo" )
2095- expect ( @settings ) . to receive ( :puts ) . with ( "baz = fud" )
2096- @settings . print_configs
2097- end
2098-
2099- it "should return true after printing" do
2100- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "something" )
2101- allow ( @settings ) . to receive ( :include? ) . with ( "something" ) . and_return ( true )
2102- allow ( @settings ) . to receive ( :value ) . with ( "something" , nil ) . and_return ( "foo" )
2103- allow ( @settings ) . to receive ( :puts ) . with ( "foo" )
2104- expect ( @settings . print_configs ) . to be_truthy
2105- end
2106-
2107- it "should return false if a config param is not found" do
2108- allow ( @settings ) . to receive ( :puts )
2109- allow ( @settings ) . to receive ( :value ) . with ( :configprint ) . and_return ( "something" )
2110- allow ( @settings ) . to receive ( :include? ) . with ( "something" ) . and_return ( false )
2111- expect ( @settings . print_configs ) . to be_falsey
2112- end
2113- end
2114-
21152059 describe "when genconfig is true" do
21162060 before do
21172061 allow ( @settings ) . to receive ( :puts )
0 commit comments