Implemented SimpleBuilder and updated Environment#add_builder method to support it
This commit is contained in:
1 parent
e279959d79
commit
92d4dd8396
8 files changed
+129
-2
No files matched your search
@@ -0,0 +1,19 @@
|
||||
module Rscons
|
||||
module Builders
|
||||
describe SimpleBuilder do
|
||||
let(:env) {Environment.new}
|
||||
|
||||
it "should create a new builder with the given name (as a symbol) and action" do
|
||||
builder = Rscons::Builders::SimpleBuilder.new(:Foo) { 0x1234 }
|
||||
expect(builder.name).to eq("Foo")
|
||||
expect(builder.run(1,2,3,4,5)).to eq(0x1234)
|
||||
end
|
||||
|
||||
it "should create a new builder with the given name (as a string) and action" do
|
||||
builder = Rscons::Builders::SimpleBuilder.new("Foo") { 0x1234 }
|
||||
expect(builder.name).to eq("Foo")
|
||||
expect(builder.run(1,2,3,4,5)).to eq(0x1234)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -72,6 +72,13 @@ module Rscons
|
||||
env.add_builder(Rscons::Builders::Object.new)
|
||||
expect(env.builders.keys).to eq ["Object"]
|
||||
end
|
||||
|
||||
it "adds a new simple builder to the list of builders" do
|
||||
env = Environment.new(exclude_builders: true)
|
||||
expect(env.builders.keys).to eq []
|
||||
env.add_builder(:Foo) {}
|
||||
expect(env.builders.keys).to eq ["Foo"]
|
||||
end
|
||||
end
|
||||
|
||||
describe "#get_build_fname" do
|
||||
|
||||
Reference in new issue
Block a user