test/runner_test.rb in ripl-0.2.2 vs test/runner_test.rb in ripl-0.2.3
- old
+ new
@@ -8,33 +8,33 @@
mock_riplrc
mock(Ripl).shell(anything) { shell = Shell.new; mock(shell).loop; shell }
Ripl.start
end
- it "sets a shell's options" do
+ it "sets a shell's variables" do
mock_riplrc
mock(Shell).create(anything) {|e| shell = Shell.new(e); mock(shell).loop; shell }
- Ripl.start(:prompt=>'$')
- Ripl.shell.options[:prompt].should == '$'
+ Ripl.start(:name=>'shh')
+ Ripl.shell.name.should == 'shh'
end
- it "overrides options set in riplrc" do
- mock_riplrc { Ripl.config[:readline] = false }
+ it "overrides config set in riplrc" do
+ mock_riplrc { Ripl.config[:name] = 'blah' }
mock(Shell).create(anything) {|e| shell = Shell.new(e); mock(shell).loop; shell }
- Ripl.start(:readline=>true)
- Ripl.shell.options[:readline].should == true
+ Ripl.start(:name=>'dude')
+ Ripl.shell.name.should == 'dude'
end
end
describe ".run" do
describe "riplrc" do
before { reset_ripl }
- it "sets a shell's options" do
+ it "sets config" do
mock_riplrc { Ripl.config[:blah] = true }
mock(Shell).create(anything) {|e| shell = Shell.new(e); mock(shell).loop; shell }
Runner.run([])
- Ripl.shell.options[:blah].should == true
+ Ripl.config[:blah].should == true
end
it "catches and prints error" do
mock(Runner).load(anything) { raise SyntaxError }
mock(Ripl).shell(anything) { shell = Shell.new; mock(shell).loop; shell }