Skip to content

Commit

Permalink
Ditch OpenStruct dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
fidel committed Jan 2, 2025
1 parent 6e3c2ca commit 8cc93be
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions contrib/ruby_event_store-flipper/spec/flipper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ module RubyEventStore
specify "enabling toggle for actor" do
Flipper.enable(event_store)

actor = OpenStruct.new(flipper_id: "User:123")
actor = mk_actor

flipper.enable_actor(:foo_bar, actor)

expect(event_store).to have_published(
Expand All @@ -88,7 +89,7 @@ module RubyEventStore
specify "disabling toggle for actor" do
Flipper.enable(event_store)

actor = OpenStruct.new(flipper_id: "User:123")
actor = mk_actor
flipper.disable_actor(:foo_bar, actor)

expect(event_store).to have_published(
Expand Down Expand Up @@ -189,6 +190,17 @@ module RubyEventStore

instrumenter.instrument("feature_operation.flipper", operation: :enabled?, feature_name: "foo_bar")
instrumenter.instrument("feature_operation.flipper", operation: :exist?, feature_name: "foo_bar")

private

def mk_actor
Class
.new do
def flipper_id
"User:123"
end
end
.new
end
end
end

0 comments on commit 8cc93be

Please sign in to comment.