add Environment#clear_targets()
This commit is contained in:
parent
539a49fe90
commit
e667046da8
@ -162,6 +162,11 @@ module Rscons
|
||||
cache.write
|
||||
end
|
||||
|
||||
# Clear all targets registered for the Environment.
|
||||
def clear_targets
|
||||
@targets = {}
|
||||
end
|
||||
|
||||
# Build a command line from the given template, resolving references to
|
||||
# variables using the Environment's construction variables and any extra
|
||||
# variables specified.
|
||||
|
@ -148,6 +148,18 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
describe "#clear_targets" do
|
||||
it "resets @targets to an empty hash" do
|
||||
env = Environment.new
|
||||
env.Program("a.out", "main.o")
|
||||
expect(env.instance_variable_get(:@targets).keys).to eq(["a.out"])
|
||||
|
||||
env.clear_targets
|
||||
|
||||
expect(env.instance_variable_get(:@targets).keys).to eq([])
|
||||
end
|
||||
end
|
||||
|
||||
describe "#build_command" do
|
||||
it "returns a command based on the variables in the Environment" do
|
||||
env = Environment.new
|
||||
|
Loading…
x
Reference in New Issue
Block a user