Modified: MacRuby/trunk/mspec/lib/mspec/commands/mspec.rb (2711 => 2712)
--- MacRuby/trunk/mspec/lib/mspec/commands/mspec.rb 2009-10-04 20:22:02 UTC (rev 2711)
+++ MacRuby/trunk/mspec/lib/mspec/commands/mspec.rb 2009-10-04 21:44:14 UTC (rev 2712)
@@ -35,7 +35,7 @@
options.targets
options.on("-D", "--gdb", "Run under gdb") do
- config[:flags] << '--gdb'
+ config[:use_gdb] = true
end
options.on("-A", "--valgrind", "Run under valgrind") do
config[:flags] << '--valgrind'
@@ -149,7 +149,12 @@
if config[:multi] and config[:command] == "ci"
multi_exec argv
else
- exec config[:target], *argv
+ if config[:use_gdb]
+ more = ["--args", config[:target]] + argv
+ exec "gdb", *more
+ else
+ exec config[:target], *argv
+ end
end
end
end
Modified: MacRuby/trunk/mspec/spec/commands/mspec_spec.rb (2711 => 2712)
--- MacRuby/trunk/mspec/spec/commands/mspec_spec.rb 2009-10-04 20:22:02 UTC (rev 2711)
+++ MacRuby/trunk/mspec/spec/commands/mspec_spec.rb 2009-10-04 21:44:14 UTC (rev 2712)
@@ -270,11 +270,11 @@
@script.options
end
- it "sets flags to --gdb" do
+ it "sets use_gdb to true" do
["-D", "--gdb"].each do |opt|
- @config[:flags] = []
+ @config[:use_gdb] = false
@script.options [opt]
- @config[:flags].should include("--gdb")
+ @config[:use_gdb].should be_true
end
end
end