Skip to content

Commit

Permalink
Add, delete and list rules
Browse files Browse the repository at this point in the history
o PowerTrack API defined by the PowerTrack::API module
o PowerTrack API implemented by the PowerTrack::Stream class
o PowerTrack-specific exception hierarchy
o EventMachine and em-http-request used as a foundation for HTTP calls
  • Loading branch information
Laurent Farcy committed Jul 17, 2015
1 parent 2550398 commit 6db8982
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_stream_add_rules.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'minitest_helper'
require 'powertrack'
require 'multi_json'

class TestRule < Minitest::Test

def test_add_a_single_rule
stream = PowerTrack::Stream.new(
'laurent.farcy@ecairn.com',
'piodv-717',
'eCairn',
'twitter',
'prod')

rule = PowerTrack::Rule.new('coke')
p stream.list_rules
p stream.add_rule(rule)
p stream.list_rules(false)
p stream.delete_rules(rule)
p stream.list_rules
end
end

0 comments on commit 6db8982

Please sign in to comment.