spec/configuration_spec.rb in gatling-1.0.2 vs spec/configuration_spec.rb in gatling-1.0.3
- old
+ new
@@ -15,17 +15,53 @@
end
end
end
end
+
+
it "should default to <Rails.root>/spec/reference_images" do
Gatling::Configuration.reference_image_path.should eql("fake_rails_root/spec/reference_images")
end
- it "should be overrideable" do
+ it "should be overrideable" do
Gatling::Configuration.reference_image_path = "my custom path"
Gatling::Configuration.reference_image_path.should eql("my custom path")
end
+
+
+ end
+
+ describe '#trainer_toggle' do
+
+ it 'should default to false' do
+ Gatling::Configuration.trainer_toggle.should eql(false)
+ end
+ it 'can be toggled to true' do
+ Gatling::Configuration.trainer_toggle = true
+ Gatling::Configuration.trainer_toggle.should eql(true)
+ end
+
+ it 'toggeled using GATLING_TRAINER = false' do
+ ENV['GATLING_TRAINER'] = 'false'
+ Gatling::Configuration.trainer_toggle.should eql(false)
+ end
+
+ it 'toggeled using GATLING_TRAINER = true' do
+ ENV['GATLING_TRAINER'] = 'true'
+ Gatling::Configuration.trainer_toggle.should eql(true)
+ end
+
+ it 'toggeled using GATLING_TRAINER = nil' do
+ ENV['GATLING_TRAINER'] = nil
+ Gatling::Configuration.trainer_toggle.should eql(false)
+ end
+
+ after(:each) do
+ Gatling::Configuration.trainer_toggle = false
+ ENV['GATLING_TRAINER'] = nil
+ end
+
end
end
\ No newline at end of file