Skip to content

Commit

Permalink
Change feature_enabled to camelCase format
Browse files Browse the repository at this point in the history
  • Loading branch information
aruizs committed Jan 1, 2024
1 parent 187e1e3 commit b9188cc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ unleashClient.isEnabled("feature.toogle");
std::string name;
unsigned int weight;
bool enabled;
bool feature_enabled;
bool featureEnabled;
std::string payload;
}
*/
Expand Down
2 changes: 1 addition & 1 deletion include/unleash/variants/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct variant_t {
std::string name;
unsigned int weight;
bool enabled;
bool feature_enabled;
bool featureEnabled;
std::string payload;
};

Expand Down
2 changes: 1 addition & 1 deletion src/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ variant_t Feature::getVariant(const unleash::Context &context) const {
variant_t variant{"disabled", 0, false, false};
if (!isEnabled(context)) { return variant; }

variant.feature_enabled = true;
variant.featureEnabled = true;
if (m_variants.first.empty()) { return variant; }

variant.enabled = true;
Expand Down
2 changes: 1 addition & 1 deletion src/unleashclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bool UnleashClient::isEnabled(const std::string &flag, const Context &context) {
variant_t UnleashClient::variant(const std::string &flag, const unleash::Context &context) {
variant_t variant{"disabled", 0, false, false};
if (m_isInitialized) {
variant.feature_enabled = isEnabled(flag, context);
variant.featureEnabled = isEnabled(flag, context);
if (auto search = m_features.find(flag); search != m_features.end()) {
return m_features.at(flag).getVariant(context);
}
Expand Down
2 changes: 1 addition & 1 deletion test/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ TEST_P(UnleashSpecificationTest, TestSet) {
std::cout << value["toggleName"] << std::endl;
nlohmann::json expectedResult = value["expectedResult"];
auto variant = unleashClient.variant(value["toggleName"], testContext);
EXPECT_EQ(expectedResult["feature_enabled"], variant.feature_enabled);
EXPECT_EQ(expectedResult["feature_enabled"], variant.featureEnabled);
EXPECT_EQ(expectedResult["enabled"], variant.enabled);
EXPECT_EQ(expectedResult["name"], variant.name);
if (expectedResult.contains("payload")) EXPECT_EQ(expectedResult["payload"].dump(), variant.payload);
Expand Down

0 comments on commit b9188cc

Please sign in to comment.