Skip to content

Commit

Permalink
Revert "Fixed failing unit test"
Browse files Browse the repository at this point in the history
This reverts commit 0d9ec3d.
  • Loading branch information
Vasu1105 committed Oct 19, 2023
1 parent 090d5ec commit efca4c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
19 changes: 5 additions & 14 deletions test/unit/plugins/transport_test.rb
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
require "helper"

describe "v1 Transport Plugin" do
let(:default_options) {
{
enable_audit_log: false,
audit_log_location: nil,
audit_log_app_name: "train",
audit_log_size: 2000000,
audit_log_frequency: "daily",
}
}

describe "empty v1 transport plugin" do
let(:plugin) { Class.new(Train.plugin(1)) }

it "initializes an empty configuration" do
_(plugin.new.options).must_equal(default_options)
_(plugin.new.options).must_equal({})
end

it "saves the provided configuration" do
conf = default_options.merge({ a: rand })
conf = { a: rand }
_(plugin.new(conf).options).must_equal(conf)
end

it "saves the provided configuration" do
conf = default_options.merge({ a: rand })
conf = { a: rand }
_(plugin.new(conf).options).must_equal(conf)
end

Expand Down Expand Up @@ -78,8 +70,7 @@ def train_class(opts = {})

it "exposes the parameters via api" do
name, plugin = train_class
output = default_options.keys << name
_(plugin.default_options.keys).must_equal output
_(plugin.default_options.keys).must_equal [name]
end

it "exposes the parameters via api" do
Expand Down
9 changes: 4 additions & 5 deletions test/unit/train_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,20 @@

it "provides empty options of a transport plugin" do
Class.new(Train.plugin 1) { name "none" }
_(Train.options("none")).must_equal(default_options)
_(Train.options("none")).must_equal({})
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
output = default_options.merge(
_(Train.options("one")).must_equal({
one: {
required: true,
default: 123,
}
)
_(Train.options("one")).must_equal(output)
},
})
end
end

Expand Down

0 comments on commit efca4c7

Please sign in to comment.