repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twitter_favorites_spec.rb
spec/models/agents/twitter_favorites_spec.rb
require 'rails_helper' describe Agents::TwitterFavorites do before do stub_request(:any, /tectonic.*[?&]tweet_mode=extended/) .to_return(body: File.read(Rails.root.join("spec/data_fixtures/user_fav_tweets.json")), headers: { 'Content-Type': 'application/json;charset=utf-8' }, ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/sentiment_agent_spec.rb
spec/models/agents/sentiment_agent_spec.rb
require 'rails_helper' describe Agents::SentimentAgent do before do @valid_params = { :name => "somename", :options => { :content => "$.message", :expected_receive_period_in_days => 1 } } @checker = Agents::SentimentAgent....
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/weather_agent_spec.rb
spec/models/agents/weather_agent_spec.rb
require 'rails_helper' describe Agents::WeatherAgent do let(:agent) do Agents::WeatherAgent.create( name: 'weather', options: { :location => "37.77550,-122.41292", :api_key => 'test', :which_day => 1, } ).tap do |agent| agent.user = users(:bob) agent.sa...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/local_file_agent_spec.rb
spec/models/agents/local_file_agent_spec.rb
require 'rails_helper' describe Agents::LocalFileAgent do before(:each) do @valid_params = { 'mode' => 'read', 'watch' => 'false', 'append' => 'false', 'path' => File.join(Rails.root, 'tmp', 'spec') } ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/delay_agent_spec.rb
spec/models/agents/delay_agent_spec.rb
require 'rails_helper' describe Agents::DelayAgent do let(:agent) { Agents::DelayAgent.create!( name: 'My DelayAgent', user: users(:bob), options: default_options.merge('max_events' => 2), sources: [agents(:bob_website_agent)] ) } let(:default_options) { Agents::DelayAgent.new.de...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/data_output_agent_spec.rb
spec/models/agents/data_output_agent_spec.rb
# encoding: utf-8 require 'rails_helper' describe Agents::DataOutputAgent do let(:agent) do _agent = Agents::DataOutputAgent.new(:name => 'My Data Output Agent') _agent.options = _agent.default_options.merge('secrets' => ['secret1', 'secret2'], 'events_to_show' => 3) _agent.options['template']['item']['...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/human_task_agent_spec.rb
spec/models/agents/human_task_agent_spec.rb
require 'rails_helper' describe Agents::HumanTaskAgent do before do @checker = Agents::HumanTaskAgent.new(name: 'my human task agent') @checker.options = @checker.default_options @checker.user = users(:bob) @checker.save! @event = Event.new @event.agent = agents(:bob_rain_notifier_agent) ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/liquid_output_agent_spec.rb
spec/models/agents/liquid_output_agent_spec.rb
# encoding: utf-8 require 'rails_helper' describe Agents::LiquidOutputAgent do let(:agent) do _agent = Agents::LiquidOutputAgent.new(name: 'My Data Output Agent') _agent.options = _agent.default_options.merge( 'secret' => 'a secret1', 'events_to_show' => 3, ) _agent.user = users(:bob) ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twilio_agent_spec.rb
spec/models/agents/twilio_agent_spec.rb
require 'rails_helper' describe Agents::TwilioAgent do before do @checker = Agents::TwilioAgent.new(:name => 'somename', :options => { :account_sid => 'x', :auth_token => 'x', ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/jabber_agent_spec.rb
spec/models/agents/jabber_agent_spec.rb
require 'rails_helper' describe Agents::JabberAgent do let(:sent) { [] } let(:config) { { jabber_server: '127.0.0.1', jabber_port: '5222', jabber_sender: 'foo@localhost', jabber_receiver: 'bar@localhost', jabber_password: 'password', message: 'Warning! {{title}} - {{url}}', ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/dropbox_watch_agent_spec.rb
spec/models/agents/dropbox_watch_agent_spec.rb
require 'rails_helper' describe Agents::DropboxWatchAgent do before(:each) do @agent = Agents::DropboxWatchAgent.new( name: 'save to dropbox', options: { access_token: '70k3n', dir_to_watch: '/my/dropbox/dir', expected_update_period_in_days: 2 } ) @agent.user = u...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/public_transport_agent_spec.rb
spec/models/agents/public_transport_agent_spec.rb
require 'rails_helper' describe Agents::PublicTransportAgent do before do valid_params = { "name" => "sf muni agent", "options" => { "alert_window_in_minutes" => "20", "stops" => ['N|5221', 'N|5215'], "agency" => "sf-muni" } } @agent = Agents::PublicTransportAgent...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/rss_agent_spec.rb
spec/models/agents/rss_agent_spec.rb
require 'rails_helper' describe Agents::RssAgent do before do @valid_options = { 'expected_update_period_in_days' => "2", 'url' => "https://github.com/cantino/huginn/commits/master.atom", } stub_request(:any, /github.com/).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/gith...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/aftership_agent_spec.rb
spec/models/agents/aftership_agent_spec.rb
require 'rails_helper' describe Agents::AftershipAgent do before do stub_request(:get, /trackings/).to_return( :body => File.read(Rails.root.join("spec/data_fixtures/aftership.json")), :status => 200, :headers => {"Content-Type" => "text/json"} ) @opts = { "api_key" => '800deeaf...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/pushbullet_agent_spec.rb
spec/models/agents/pushbullet_agent_spec.rb
require 'rails_helper' describe Agents::PushbulletAgent do before(:each) do @valid_params = { 'api_key' => 'token', 'device_id' => '124', 'body' => '{{body}}', 'url' => 'url', 'name' =>...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twitter_stream_agent_spec.rb
spec/models/agents/twitter_stream_agent_spec.rb
require 'rails_helper' describe Agents::TwitterStreamAgent do before do @opts = { consumer_key: "---", consumer_secret: "---", oauth_token: "---", oauth_token_secret: "---", filters: %w[keyword1 keyword2], expected_update_period_in_days: "2", generate: "events", in...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/witai_agent_spec.rb
spec/models/agents/witai_agent_spec.rb
require 'rails_helper' describe Agents::WitaiAgent do before do stub_request(:get, /wit/).to_return(:body => File.read(Rails.root.join('spec/data_fixtures/witai.json')), :status => 200, :headers => {'Content-Type' => 'text/json'}) @valid_params = { :server_access_token => 'x', :expected_receive_...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/manual_event_agent_spec.rb
spec/models/agents/manual_event_agent_spec.rb
require 'rails_helper' describe Agents::ManualEventAgent do before do @checker = Agents::ManualEventAgent.new(name: "My Manual Event Agent") @checker.user = users(:jane) @checker.save! end describe "#handle_details_post" do it "emits an event with the given payload" do expect { jso...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/webhook_agent_spec.rb
spec/models/agents/webhook_agent_spec.rb
require 'rails_helper' describe Agents::WebhookAgent do let(:agent) do _agent = Agents::WebhookAgent.new(:name => 'webhook', :options => { 'secret' => 'foobar', 'payload_path' => 'some_key' }) _agent.user = users(:bob) _agent.save! _agent end let(:payload) { ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/website_agent_spec.rb
spec/models/agents/website_agent_spec.rb
require 'rails_helper' describe Agents::WebsiteAgent do describe "checking without basic auth" do before do stub_request(:any, /xkcd/).to_return(body: File.read(Rails.root.join("spec/data_fixtures/xkcd.html")), status: 200, ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
true
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/event_formatting_agent_spec.rb
spec/models/agents/event_formatting_agent_spec.rb
require 'rails_helper' describe Agents::EventFormattingAgent do before do @valid_params = { :name => "somename", :options => { :instructions => { :message => "Received {{content.text}} from {{content.name}} .", :subject => "Weather looks like {{conditio...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/tumblr_likes_agent_spec.rb
spec/models/agents/tumblr_likes_agent_spec.rb
require 'rails_helper' describe Agents::TumblrLikesAgent do before do allow_any_instance_of(Agents::TumblrLikesAgent).to receive(:tumblr) { double.tap { |obj| allow(obj).to receive(:blog_likes).with('wendys.tumblr.com', after: 0) { JSON.parse File.read(Rails.root.join('spec/data_fixtures/...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twitter_publish_agent_spec.rb
spec/models/agents/twitter_publish_agent_spec.rb
require 'rails_helper' describe Agents::TwitterPublishAgent do before do @opts = { :username => "HuginnBot", :expected_update_period_in_days => "2", :consumer_key => "---", :consumer_secret => "---", :oauth_token => "---", :oauth_token_secret => "---", :message => "{{tex...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twitter_user_agent_spec.rb
spec/models/agents/twitter_user_agent_spec.rb
require 'rails_helper' describe Agents::TwitterUserAgent do before do # intercept the twitter API request for @tectonic's user profile stub_request(:any, "https://api.twitter.com/1.1/statuses/user_timeline.json?contributor_details=true&count=200&exclude_replies=false&include_entities=true&include_rts=true&sc...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twilio_receive_text_agent_spec.rb
spec/models/agents/twilio_receive_text_agent_spec.rb
require 'rails_helper' # Twilio Params # https://www.twilio.com/docs/api/twiml/sms/twilio_request # url: https://b924379f.ngrok.io/users/1/web_requests/7/sms-endpoint # params: {"ToCountry"=>"US", "ToState"=>"NY", "SmsMessageSid"=>"SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "NumMedia"=>"0", "ToCity"=>"NEW YORK", "FromZip"=>...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/jq_agent_spec.rb
spec/models/agents/jq_agent_spec.rb
require 'rails_helper' describe Agents::JqAgent do def create_event(payload) agents(:jane_weather_agent).events.create!(payload: payload) end let!(:agent) { Agents::JqAgent.create!( name: 'somename', options: { filter: '.+{"total": .numbers | add} | del(.numbers)' }, user...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/jira_agent_spec.rb
spec/models/agents/jira_agent_spec.rb
require 'rails_helper' describe Agents::JiraAgent do before(:each) do stub_request(:get, /atlassian.com/).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/jira.json")), :status => 200, :headers => {"Content-Type" => "text/json"}) @valid_params = { :username => "user", :password...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/json_parse_agent_spec.rb
spec/models/agents/json_parse_agent_spec.rb
require 'rails_helper' describe Agents::JsonParseAgent do before(:each) do @checker = Agents::JsonParseAgent.new(:name => "somename", :options => Agents::JsonParseAgent.new.default_options) @checker.user = users(:jane) @checker.save! end it "event description does not throw an exception" do expe...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/gap_detector_agent_spec.rb
spec/models/agents/gap_detector_agent_spec.rb
require 'rails_helper' describe Agents::GapDetectorAgent do let(:valid_params) { { 'name' => "my gap detector agent", 'options' => { 'window_duration_in_days' => "2", 'message' => "A gap was found!" } } } let(:agent) { _agent = Agents::GapDetectorAgent.new(valid_par...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/dropbox_file_url_agent_spec.rb
spec/models/agents/dropbox_file_url_agent_spec.rb
require 'rails_helper' describe Agents::DropboxFileUrlAgent do before(:each) do @agent = Agents::DropboxFileUrlAgent.new( name: 'dropbox file to url', options: {} ) @agent.user = users(:bob) @agent.service = services(:generic) @agent.save! end it 'cannot be scheduled' do expe...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twitter_action_agent_spec.rb
spec/models/agents/twitter_action_agent_spec.rb
require 'rails_helper' describe Agents::TwitterActionAgent do describe '#receive' do before do @event1 = Event.new @event1.agent = agents(:bob_twitter_user_agent) @event1.payload = { id: 123, text: 'So awesome.. gotta retweet' } @event1.save! @tweet1 = Twitter::Tweet.new( id...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/tumblr_publish_agent_spec.rb
spec/models/agents/tumblr_publish_agent_spec.rb
require 'rails_helper' describe Agents::TumblrPublishAgent do describe "Should create post" do before do @opts = { :blog_name => "huginnbot.tumblr.com", :post_type => "text", :expected_update_period_in_days => "2", :options => { :title => "{{title}}", :bo...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/post_agent_spec.rb
spec/models/agents/post_agent_spec.rb
require 'rails_helper' require 'ostruct' describe Agents::PostAgent do let(:mocked_response) do { status: 200, body: "<html>a webpage!</html>", headers: { 'Content-type' => 'text/html', 'X-Foo-Bar' => 'baz', } } end before do @valid_options = { 'post_url...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/email_agent_spec.rb
spec/models/agents/email_agent_spec.rb
require 'rails_helper' describe Agents::EmailAgent do it_behaves_like EmailConcern def get_message_part(mail, content_type) mail.body.parts.find { |p| p.content_type.match content_type }.body.raw_source end before do @checker = Agents::EmailAgent.new(:name => "something", :options => { :expected_rece...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/phantom_js_cloud_agent_spec.rb
spec/models/agents/phantom_js_cloud_agent_spec.rb
require 'rails_helper' describe Agents::PhantomJsCloudAgent do before do @valid_options = { 'name' => "XKCD", 'render_type' => "html", 'url' => "http://xkcd.com", 'mode' => 'clean', 'api_key' => '1234567890' } @checker = Agents::PhantomJsCloudAgent.new(:name =>...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/hipchat_agent_spec.rb
spec/models/agents/hipchat_agent_spec.rb
require 'rails_helper' describe Agents::HipchatAgent do before(:each) do @valid_params = { 'auth_token' => 'token', 'room_name' => 'test', 'username' => "{{username}}", 'message' => "{{message}}", 'notify' => 'false', 'color' => 'yellow', } @checker = Agents::HipchatA...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/adioso_agent_spec.rb
spec/models/agents/adioso_agent_spec.rb
require 'rails_helper' describe Agents::AdiosoAgent do before do stub_request(:get, /parse/).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/adioso_parse.json")), :status => 200, :headers => {"Content-Type" => "text/json"}) stub_request(:get, /fares/).to_return(:body => File.read(Rails.root.join(...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/slack_agent_spec.rb
spec/models/agents/slack_agent_spec.rb
require 'rails_helper' describe Agents::SlackAgent do before(:each) do @fallback = "Its going to rain" @attachments = [{'fallback' => "{{fallback}}"}] @valid_params = { 'webhook_url' => 'https://hooks.slack.com/services/random1/random2/token', 'channel' => '#ra...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/mqtt_agent_spec.rb
spec/models/agents/mqtt_agent_spec.rb
require 'rails_helper' require 'mqtt' require './spec/support/fake_mqtt_server' describe Agents::MqttAgent do before :each do @error_log = StringIO.new @server = MQTT::FakeServer.new('127.0.0.1') @server.logger = Logger.new(@error_log) @server.logger.level = Logger::DEBUG @server.start @va...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/trigger_agent_spec.rb
spec/models/agents/trigger_agent_spec.rb
require 'rails_helper' describe Agents::TriggerAgent do before do @valid_params = { 'name' => "my trigger agent", 'options' => { 'expected_receive_period_in_days' => 2, 'rules' => [{ 'type' => "regex", 'value' => "a\\db", 'path' => "foo.bar.baz", ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/shell_command_agent_spec.rb
spec/models/agents/shell_command_agent_spec.rb
require 'rails_helper' describe Agents::ShellCommandAgent do before do @valid_path = Dir.pwd @valid_params = { path: @valid_path, command: 'pwd', expected_update_period_in_days: '1', } @valid_params2 = { path: @valid_path, command: [RbConfig.ruby, '-e', ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/digest_agent_spec.rb
spec/models/agents/digest_agent_spec.rb
require "rails_helper" describe Agents::DigestAgent do before do @checker = Agents::DigestAgent.new(:name => "something", :options => { :expected_receive_period_in_days => "2", :retained_events => "0", :message => "{{ events | map:'data' | join:';' }}" }) @checker.user = users(:bob) @checker.save! end ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/telegram_agent_spec.rb
spec/models/agents/telegram_agent_spec.rb
require 'rails_helper' describe Agents::TelegramAgent do before do default_options = { auth_token: 'xxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', chat_id: 'xxxxxxxx', caption: '{{ caption }}', disable_web_page_preview: '{{ disable_web_page_preview }}', disable_notification: '{{ si...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/weibo_publish_agent_spec.rb
spec/models/agents/weibo_publish_agent_spec.rb
# encoding: utf-8 require 'rails_helper' describe Agents::WeiboPublishAgent do before do @opts = { :uid => "1234567", :expected_update_period_in_days => "2", :app_key => "---", :app_secret => "---", :access_token => "---", :message_path => "text", :pic_path => "pic" ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/attribute_difference_agent_spec.rb
spec/models/agents/attribute_difference_agent_spec.rb
require 'rails_helper' describe Agents::AttributeDifferenceAgent do def create_event(value=nil) event = Event.new event.agent = agents(:jane_weather_agent) event.payload = { rate: value } event.save! event end before do @valid_params = { path: 'rate', output: 'rate...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/de_duplication_agent_spec.rb
spec/models/agents/de_duplication_agent_spec.rb
require 'rails_helper' describe Agents::DeDuplicationAgent do def create_event(output=nil) event = Event.new event.agent = agents(:jane_weather_agent) event.payload = { :output => output } event.save! event end before do @valid_params = { :property => "{{output}}", ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/http_status_agent_spec.rb
spec/models/agents/http_status_agent_spec.rb
require 'rails_helper' describe 'HttpStatusAgent' do before do stub_request(:get, 'http://google.com/') end let(:default_url) { 'http://google.com/' } let(:agent_options) do { url: "{{ url | default: '#{default_url}' }}", headers_to_save: '{{ headers_to_save }}', } end let(:agent...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/user_location_agent_spec.rb
spec/models/agents/user_location_agent_spec.rb
require 'rails_helper' describe Agents::UserLocationAgent do before do @agent = Agent.build_for_type('Agents::UserLocationAgent', users(:bob), :name => 'something', :options => { :secret => 'my_secret', :max_a...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/imap_folder_agent_spec.rb
spec/models/agents/imap_folder_agent_spec.rb
require 'rails_helper' require 'time' describe Agents::ImapFolderAgent do module MessageMixin def folder 'INBOX' end def uidvalidity 100 end def has_attachment? false end def body_parts(mime_types = %(text/plain text/enriched text/html)) mime_types.map do |type|...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/java_script_agent_spec.rb
spec/models/agents/java_script_agent_spec.rb
require 'rails_helper' describe Agents::JavaScriptAgent do before do @valid_params = { name: "somename", options: { code: "Agent.check = function() { this.createEvent({ 'message': 'hi' }); };", } } @agent = Agents::JavaScriptAgent.new(@valid_params) @agent.user = users(:jan...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/google_translation_agent_spec.rb
spec/models/agents/google_translation_agent_spec.rb
require 'rails_helper' describe Agents::GoogleTranslationAgent, :vcr do before do @valid_params = { name: "somename", options: { to: "sv", from: "en", google_api_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', expected_receive_period_in_days: 1, content: { ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/csv_agent_spec.rb
spec/models/agents/csv_agent_spec.rb
require 'rails_helper' describe Agents::CsvAgent do before(:each) do @valid_params = { 'mode' => 'parse', 'separator' => ',', 'use_fields' => '', 'output' => 'event_per_row', 'with_header' => 'true', ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/s3_agent_spec.rb
spec/models/agents/s3_agent_spec.rb
require 'rails_helper' describe Agents::S3Agent do before(:each) do @valid_params = { 'mode' => 'read', 'access_key_id' => '32343242', 'access_key_secret' => '1231312', 'watch' => 'false', 'bucket' => 't...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/peak_detector_agent_spec.rb
spec/models/agents/peak_detector_agent_spec.rb
require 'rails_helper' describe Agents::PeakDetectorAgent do before do @valid_params = { 'name' => "my peak detector agent", 'options' => { 'expected_receive_period_in_days' => "2", 'group_by_path' => "filter", 'value_path' => "count", 'message' => "A peak ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/pdf_agent_spec.rb
spec/models/agents/pdf_agent_spec.rb
require 'rails_helper' describe Agents::PdfInfoAgent do let(:agent) do _agent = Agents::PdfInfoAgent.new(name: "PDF Info Agent") _agent.user = users(:bob) _agent.sources << agents(:bob_website_agent) _agent.save! _agent end describe "#receive" do before do @event = Event.new(payloa...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/scheduler_agent_spec.rb
spec/models/agents/scheduler_agent_spec.rb
require 'rails_helper' describe Agents::SchedulerAgent do let(:valid_params) { { name: 'Example', options: { 'action' => 'run', 'schedule' => '0 * * * *' }, } } let(:agent) { described_class.create!(valid_params) { |agent| agent.user = users(:bob) } } ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/commander_agent_spec.rb
spec/models/agents/commander_agent_spec.rb
require 'rails_helper' describe Agents::CommanderAgent do let(:target) { agents(:bob_website_agent) } let(:valid_params) { { name: 'Example', schedule: 'every_1h', options: { 'action' => 'run', }, user: users(:bob), control_targets: [target] } } let(:...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/twitter_search_agent_spec.rb
spec/models/agents/twitter_search_agent_spec.rb
require 'rails_helper' describe Agents::TwitterSearchAgent do before do # intercept the twitter API request stub_request(:any, /freebandnames.*[?&]tweet_mode=extended/). to_return(body: File.read(Rails.root.join("spec/data_fixtures/search_tweets.json")), headers: { 'Content-Type': 'appl...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/google_calendar_publish_agent_spec.rb
spec/models/agents/google_calendar_publish_agent_spec.rb
require 'rails_helper' describe Agents::GoogleCalendarPublishAgent do let(:valid_params) do { 'expected_update_period_in_days' => '10', 'calendar_id' => calendar_id, 'google' => { 'key_file' => File.dirname(__FILE__) + '/../../data_fixtures/private.key', 'key_secret' => 'notasec...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/ftpsite_agent_spec.rb
spec/models/agents/ftpsite_agent_spec.rb
require 'rails_helper' require 'time' describe Agents::FtpsiteAgent do describe "checking anonymous FTP" do before do @site = { 'expected_update_period_in_days' => 1, 'url' => "ftp://ftp.example.org/pub/releases/", 'patterns' => ["example*.tar.gz"], 'mode' => 'read', ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/evernote_agent_spec.rb
spec/models/agents/evernote_agent_spec.rb
require 'rails_helper' describe Agents::EvernoteAgent do class FakeEvernoteNoteStore attr_accessor :notes, :tags, :notebooks def initialize @notes, @tags, @notebooks = [], [], [] end def createNote(note) note.attributes = OpenStruct.new(source: nil, sourceURL: nil) note.guid = @not...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/email_digest_agent_spec.rb
spec/models/agents/email_digest_agent_spec.rb
require 'rails_helper' describe Agents::EmailDigestAgent do it_behaves_like EmailConcern def get_message_part(mail, content_type) mail.body.parts.find { |p| p.content_type.match content_type }.body.raw_source end before do @checker = Agents::EmailDigestAgent.new(:name => "something", :options => {:ex...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/read_file_agent_spec.rb
spec/models/agents/read_file_agent_spec.rb
require 'rails_helper' describe Agents::ReadFileAgent do before(:each) do @valid_params = { 'data_key' => 'data', } @checker = Agents::ReadFileAgent.new(:name => 'somename', :options => @valid_params) @checker.user = users(:jane) @checker.save! end it_b...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/key_value_store_agent_spec.rb
spec/models/agents/key_value_store_agent_spec.rb
require "rails_helper" describe Agents::KeyValueStoreAgent do let(:value_template) { "{{ _event_ | as_object }}" } let(:agent) do Agents::KeyValueStoreAgent.create!( name: "somename", options: { key: "{{ id }}", value: value_template, variable: "kvs", max_keys: 3, ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/weibo_user_agent_spec.rb
spec/models/agents/weibo_user_agent_spec.rb
# encoding: utf-8 require 'rails_helper' describe Agents::WeiboUserAgent do before do # intercept the twitter API request for @tectonic's user profile stub_request(:any, /api.weibo.com/).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/one_weibo.json")), :status => 200) @opts = { ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/pushover_agent_spec.rb
spec/models/agents/pushover_agent_spec.rb
require 'rails_helper' describe Agents::PushoverAgent do before do @checker = Agents::PushoverAgent.new(name: 'Some Name', options: { token: 'x', user: 'x', ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/models/agents/stubhub_agent_spec.rb
spec/models/agents/stubhub_agent_spec.rb
require 'rails_helper' describe Agents::StubhubAgent do let(:name) { 'Agent Name' } let(:url) { 'https://www.stubhub.com/event/name-1-1-2014-12345' } let(:parsed_body) { JSON.parse(body)['response']['docs'][0] } let(:valid_params) { { 'url' => parsed_body['url'] } } let(:body) { File.read(Rails.root.join('s...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/form_configurable_feature_spec.rb
spec/features/form_configurable_feature_spec.rb
require 'capybara_helper' describe "form configuring agents", js: true do it 'completes fields with predefined array values' do login_as(users(:bob)) visit edit_agent_path(agents(:bob_csv_agent)) check('Propagate immediately') select2("serialize", from: "Mode", match: :first) end end
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/scenario_import_spec.rb
spec/features/scenario_import_spec.rb
require 'rails_helper' describe ScenarioImportsController do let(:user) { users(:bob) } before do login_as(user) end it 'renders the import form' do visit new_scenario_imports_path expect(page).to have_text('Import a Public Scenario') end it 'requires a URL or file uplaod' do visit new_s...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/admin_users_spec.rb
spec/features/admin_users_spec.rb
require 'rails_helper' describe Admin::UsersController do it "requires to be signed in as an admin" do login_as(users(:bob)) visit admin_users_path expect(page).to have_text('Admin access required to view that page.') end context "as an admin" do before :each do login_as(users(:jane)) ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/create_an_agent_spec.rb
spec/features/create_an_agent_spec.rb
require 'rails_helper' describe "Creating a new agent", js: true do before(:each) do login_as(users(:bob)) end it "creates an agent" do visit "/" page.find("a", text: "Agents").hover click_on("New Agent") select_agent_type("Trigger Agent") fill_in(:agent_name, with: "Test Trigger Agent"...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/undefined_agents_spec.rb
spec/features/undefined_agents_spec.rb
require 'capybara_helper' describe "handling undefined agents" do before do login_as(users(:bob)) agent = agents(:bob_website_agent) agent.update_attribute(:type, 'Agents::UndefinedAgent') end it 'renders the error page' do visit agents_path expect(page).to have_text("Error: Agent(s) are 'mi...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/edit_an_agent_spec.rb
spec/features/edit_an_agent_spec.rb
require 'rails_helper' describe "Editing an agent", js: true do it "creates an alert if a agent with invalid json is submitted" do login_as(users(:bob)) visit("/agents/#{agents(:bob_website_agent).id}/edit") click_on("Toggle View") fill_in(:agent_options, with: '{ "expected_receive_period_in_d...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/dry_running_spec.rb
spec/features/dry_running_spec.rb
require 'rails_helper' describe "Dry running an Agent", js: true do let(:agent) { agents(:bob_website_agent) } let(:formatting_agent) { agents(:bob_formatting_agent) } let(:user) { users(:bob) } let(:emitter) { agents(:bob_weather_agent) } before(:each) do login_as(user) end def open_dry_run_m...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/features/toggle_visibility_of_disabled_agents.rb
spec/features/toggle_visibility_of_disabled_agents.rb
require 'capybara_helper' describe "Toggling the visibility of an agent", js: true do it "hides them if they are disabled" do login_as(users(:bob)) visit("/agents") expect { click_on("Show/Hide Disabled Agents") }.to change{ find_all(".table-striped tr").count }.by(-1) end it "shows them ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/migrations/20161124061256_convert_website_agent_template_for_merge_spec.rb
spec/migrations/20161124061256_convert_website_agent_template_for_merge_spec.rb
load 'spec/rails_helper.rb' load File.join('db/migrate', File.basename(__FILE__, '_spec.rb') + '.rb') describe ConvertWebsiteAgentTemplateForMerge do let :old_extract do { 'url' => { 'css' => "#comic img", 'value' => "@src" }, 'title' => { 'css' => "#comic img", 'value' => "@alt" }, 'hovertext'...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/migrations/20161124065838_add_templates_to_resolve_url_spec.rb
spec/migrations/20161124065838_add_templates_to_resolve_url_spec.rb
load 'spec/rails_helper.rb' load File.join('db/migrate', File.basename(__FILE__, '_spec.rb') + '.rb') describe AddTemplatesToResolveUrl do let :valid_options do { 'name' => "XKCD", 'expected_update_period_in_days' => "2", 'type' => "html", 'url' => "http://xkcd.com", 'mode' => 'on_c...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/gemfile_helper_spec.rb
spec/lib/gemfile_helper_spec.rb
require 'rails_helper' describe GemfileHelper do context 'parse_each_agent_gem' do VALID_STRINGS = [ ['huginn_nlp_agents(~> 0.2.1)', [ ['huginn_nlp_agents', '~> 0.2.1'] ]], ['huginn_nlp_agents(~> 0.2.1, git: http://github.com/dsander/huginn.git, branch: agents_in_gems)', [['hugi...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/delayed_job_worker_spec.rb
spec/lib/delayed_job_worker_spec.rb
require 'rails_helper' describe DelayedJobWorker do before do @djw = DelayedJobWorker.new end it "should run" do expect_any_instance_of(Delayed::Worker).to receive(:start) @djw.run end it "should stop" do expect_any_instance_of(Delayed::Worker).to receive(:start) @djw.run expect_any...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/time_tracker_spec.rb
spec/lib/time_tracker_spec.rb
require 'rails_helper' describe TimeTracker do describe "#track" do it "tracks execution time" do tracked_result = TimeTracker.track { sleep(0.01) } expect(tracked_result.elapsed_time).to satisfy {|v| v > 0.01 && v < 0.1} end it "returns the proc return value" do tracked_result = TimeT...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/liquid_migrator_spec.rb
spec/lib/liquid_migrator_spec.rb
require 'rails_helper' describe LiquidMigrator do describe "converting JSONPath strings" do it "should work" do expect(LiquidMigrator.convert_string("$.data", true)).to eq("{{data}}") expect(LiquidMigrator.convert_string("$.data.test", true)).to eq("{{data.test}}") expect(LiquidMigrator.convert...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/agent_runner_spec.rb
spec/lib/agent_runner_spec.rb
require 'rails_helper' # RSpec-Mocks is extremely unstable when threads are heavily involved, so stick with RR here. require 'rr' describe AgentRunner do context "without traps" do before do RR.stub.instance_of(Rufus::Scheduler).every RR.stub.instance_of(AgentRunner).set_traps @agent_runner = A...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/utils_spec.rb
spec/lib/utils_spec.rb
require 'rails_helper' describe Utils do describe "#unindent" do it "unindents to the level of the greatest consistant indention" do expect(Utils.unindent(<<-MD)).to eq("Hello World") Hello World MD expect(Utils.unindent(<<-MD)).to eq("Hello World\nThis is\nnot indented") Hello...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/google_calendar_spec.rb
spec/lib/google_calendar_spec.rb
require 'rails_helper' describe GoogleCalendar do it '#open does not mask exception in initlize' do allow(Google::Apis::CalendarV3::CalendarService).to receive(:new) do raise "test exception" end expect { GoogleCalendar.open({'google' => {}}, Rails.logger) {} }.to raise_error(/test except...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/location_spec.rb
spec/lib/location_spec.rb
require 'rails_helper' describe Location do let(:location) { Location.new( lat: BigDecimal('2.0'), lng: BigDecimal('3.0'), radius: 300, speed: 2, course: 30) } it "converts values to Float" do expect(location.lat).to be_a Float expect(location.lat).to eq 2.0 expect(...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/huginn_scheduler_spec.rb
spec/lib/huginn_scheduler_spec.rb
require 'rails_helper' require 'huginn_scheduler' describe HuginnScheduler do before(:each) do @rufus_scheduler = Rufus::Scheduler.new @scheduler = HuginnScheduler.new allow(@scheduler).to receive(:setup) @scheduler.setup!(@rufus_scheduler, Mutex.new) end after(:each) do @rufus_scheduler.shu...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/spec/lib/agents_exporter_spec.rb
spec/lib/agents_exporter_spec.rb
require 'rails_helper' describe AgentsExporter do describe "#as_json" do let(:name) { "My set of Agents" } let(:description) { "These Agents work together nicely!" } let(:guid) { "some-guid" } let(:tag_fg_color) { "#ffffff" } let(:tag_bg_color) { "#000000" } let(:icon) { 'Camera' } let(:s...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/rdbms_functions.rb
lib/rdbms_functions.rb
module RdbmsFunctions def rdbms_date_add(source, unit, amount) adapter_type = ActiveRecord::Base.connection.adapter_name.downcase.to_sym case adapter_type when :mysql, :mysql2 "DATE_ADD(`#{source}`, INTERVAL #{amount} #{unit})" when :postgresql "(#{source} + INTERVAL '#{amount} #{u...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/setup_tools.rb
lib/setup_tools.rb
require 'open3' require 'io/console' require 'securerandom' require 'shellwords' require 'active_support/core_ext/object/blank' module SetupTools def capture(cmd, opts = {}) if opts.delete(:no_stderr) o, s = Open3.capture2(cmd, opts) else o, s = Open3.capture2e(cmd, opts) end o.strip en...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/google_calendar.rb
lib/google_calendar.rb
require 'googleauth' require 'google/apis/calendar_v3' class GoogleCalendar def initialize(config, logger) @config = config if @config['google']['key'].present? # https://github.com/google/google-auth-library-ruby/issues/65 # https://github.com/google/google-api-ruby-client/issues/370 ENV[...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/agent_runner.rb
lib/agent_runner.rb
require 'cgi' require 'json' require 'rufus-scheduler' require 'pp' require 'twitter' class AgentRunner @@agents = [] def initialize(options = {}) @workers = {} @signal_queue = [] @options = options @options[:only] = [@options[:only]].flatten if @options[:only] @options[:except] = [@options[:e...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/utils.rb
lib/utils.rb
require 'jsonpath' require 'cgi' require 'uri' require 'addressable/uri' module Utils def self.unindent(s) s = s.gsub(/\t/, ' ').chomp min = ((s.split("\n").find {|l| l !~ /^\s*$/ })[/^\s+/, 0] || "").length if min > 0 s.gsub(/^#{" " * min}/, "") else s end end def self.pretty_p...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/agents_exporter.rb
lib/agents_exporter.rb
class AgentsExporter attr_accessor :options def initialize(options) self.options = options end # Filename should have no commas or special characters to support Content-Disposition on older browsers. def filename ((options[:name] || '').downcase.gsub(/[^a-z0-9_-]/, '-').gsub(/-+/, '-').gsub(/^-|-$/,...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/location.rb
lib/location.rb
require 'liquid' Location = Struct.new(:lat, :lng, :radius, :speed, :course) class Location include LiquidDroppable protected :[]= def initialize(data = {}) super() case data when Array raise ArgumentError, 'unsupported location data' unless data.size == 2 self.lat, self.lng = data ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/feedjira_extension.rb
lib/feedjira_extension.rb
require 'feedjira' require 'digest' require 'mail' module FeedjiraExtension AUTHOR_ATTRS = %i[name email uri] LINK_ATTRS = %i[href rel type hreflang title length] ENCLOSURE_ATTRS = %i[url type length] class Author < Struct.new(*AUTHOR_ATTRS) def empty? all?(&:nil?) end def to_json(options =...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/liquid_migrator.rb
lib/liquid_migrator.rb
module LiquidMigrator def self.convert_all_agent_options(agent) agent.options = self.convert_hash(agent.options, {:merge_path_attributes => true, :leading_dollarsign_is_jsonpath => true}) agent.save! end def self.convert_hash(hash, options={}) options = {:merge_path_attributes => false, :leading_doll...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/huginn_scheduler.rb
lib/huginn_scheduler.rb
require 'rufus/scheduler' class Rufus::Scheduler SCHEDULER_AGENT_TAG = Agents::SchedulerAgent.name class Job # Store an ID of SchedulerAgent in this job. def scheduler_agent_id=(id) self[:scheduler_agent_id] = id end # Extract an ID of SchedulerAgent if any. def scheduler_agent_id ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/json_with_indifferent_access.rb
lib/json_with_indifferent_access.rb
class JsonWithIndifferentAccess def self.load(json) ActiveSupport::HashWithIndifferentAccess.new(JSON.parse(json || '{}')) rescue JSON::ParserError Rails.logger.error "Unparsable JSON in JsonWithIndifferentAccess: #{json}" { 'error' => 'unparsable json detected during de-serialization' } end def se...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/delayed_job_worker.rb
lib/delayed_job_worker.rb
class DelayedJobWorker < LongRunnable::Worker include LongRunnable def run @dj = Delayed::Worker.new @dj.start end def stop @dj.stop if @dj end def self.setup_worker [new(id: self.to_s)] end end
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false
huginn/huginn
https://github.com/huginn/huginn/blob/8edec55aab03d4e3f13b205db02d21dc36e34e4f/lib/gemfile_helper.rb
lib/gemfile_helper.rb
class GemfileHelper class << self def rails_env ENV['RAILS_ENV'] || case File.basename($0) when 'rspec' 'test' when 'rake' 'test' if ARGV.any?(/\Aspec(?:\z|:)/) end || 'development' end def load_dotenv root = Pathname.new(__dir__).parent ...
ruby
MIT
8edec55aab03d4e3f13b205db02d21dc36e34e4f
2026-01-04T15:37:27.328445Z
false