Skip to content

Commit

Permalink
Fix the unit test after introducing seprate method for default audit …
Browse files Browse the repository at this point in the history
…log option

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
  • Loading branch information
Vasu1105 committed Oct 19, 2023
1 parent efca4c7 commit 2156ea3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/unit/train_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
Train::Plugins.registry.clear
end

let(:default_options) {
let(:default_audit_log_options) {
{
enable_audit_log: {
default: false,
},
audit_log_location: {
default: nil,
required: true,
default: nil,
},
audit_log_app_name: {
default: "train",
},
audit_log_size: {
default: 2000000,
default: 2097152,
},
audit_log_frequency: {
default: "daily",
Expand Down Expand Up @@ -69,22 +69,23 @@
_ { Train.options("missing") }.must_raise Train::PluginLoadError
end

it "provides empty options of a transport plugin" do
it "provides list of default options of a transport plugin" do
Class.new(Train.plugin 1) { name "none" }
_(Train.options("none")).must_equal({})
_(Train.options("none")).must_equal(default_audit_log_options)
end

it "provides all options of a transport plugin" do
Class.new(Train.plugin 1) do
name "one"
option :one, required: true, default: 123
end
_(Train.options("one")).must_equal({
output = {
one: {
required: true,
default: 123,
},
})
}
}.merge(default_audit_log_options)
_(Train.options("one")).must_equal(output)
end
end

Expand Down

0 comments on commit 2156ea3

Please sign in to comment.