create Builder instance for each build operation - close #88
This commit is contained in:
1 parent
12f1909d35
commit
aac32d20b0
28 files changed
+181
-147
No files matched your search
@@ -3,15 +3,8 @@ module Rscons
|
||||
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")
|
||||
it "should create a new builder with the given action" do
|
||||
builder = Rscons::Builders::SimpleBuilder.new { 0x1234 }
|
||||
expect(builder.run(1,2,3,4,5)).to eq(0x1234)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ module Rscons
|
||||
it "adds the default builders when they are not excluded" do
|
||||
env = Environment.new
|
||||
expect(env.builders.size).to be > 0
|
||||
expect(env.builders.map {|name, builder| builder.is_a?(Builder)}.all?).to be_truthy
|
||||
expect(env.builders.map {|name, builder| builder.is_a?(Class)}.all?).to be_truthy
|
||||
expect(env.builders.find {|name, builder| name == "Object"}).to_not be_nil
|
||||
expect(env.builders.find {|name, builder| name == "Program"}).to_not be_nil
|
||||
expect(env.builders.find {|name, builder| name == "Library"}).to_not be_nil
|
||||
@@ -52,7 +52,7 @@ module Rscons
|
||||
it "adds the builder to the list of builders" do
|
||||
env = Environment.new(exclude_builders: true)
|
||||
expect(env.builders.keys).to eq []
|
||||
env.add_builder(Rscons::Builders::Object.new)
|
||||
env.add_builder(Rscons::Builders::Object)
|
||||
expect(env.builders.keys).to eq ["Object"]
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user