test/runner_test.rb in ripl-0.2.7 vs test/runner_test.rb in ripl-0.2.8
- old
+ new
@@ -8,17 +8,30 @@
mock_riplrc
mock_shell
Ripl.start
end
+ it "doesn't load riplrc" do
+ mock_shell
+ dont_allow(Runner).load_rc(anything)
+ Ripl.start :riplrc => false
+ end
+
it "sets a shell's variables" do
mock_riplrc
mock_shell
Ripl.start(:name=>'shh')
Ripl.shell.name.should == 'shh'
end
+ it "passes options to Ripl.config" do
+ mock_riplrc
+ mock_shell
+ Ripl.start(:history=>'~/.mah_history')
+ Ripl.config[:history].should == '~/.mah_history'
+ end
+
it "overrides config set in riplrc" do
mock_riplrc { Ripl.config[:name] = 'blah' }
mock_shell
Ripl.start(:name=>'dude')
Ripl.shell.name.should == 'dude'
@@ -65,9 +78,15 @@
it "has -F global option parsed" do
mock_exec '-F'
dont_allow(Runner).load_rc(anything)
ripl("rails", "-F", :riplrc=>false)
+ end
+
+ it "saves arguments passed to it" do
+ mock_exec 'blah', '-F'
+ ripl("rails", "blah", "-F", :riplrc=>false)
+ Ripl::Runner.argv.should == ['blah', '-F']
end
it "has other global option parsed" do
mock_exec '-r=blah'
mock(Runner).require('blah')