Skip to content

Commit

Permalink
chore: upgrace bug report template
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jul 3, 2020
1 parent c817522 commit 526bcf6
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions etc/bug_report_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,26 @@
gemfile(true) do
source "https://rubygems.org"

gem "anyt"
# For AnyCable <1.0, use ~> 0.8
gem "anyt", ">= 1.0.0"
end

# Use HTTP adapter by default
ENV["ANYCABLE_BROADCAST_ADAPTER"] = "http"

require "anyt"
require "anyt/cli"
require "anycable-rails"

# WebSocket server url
ENV["ANYT_TARGET_URL"] ||= "ws://localhost:8080/cable"

# Command to launch WebSocket server.
# Comment this line if you want to run WebSocket server manually
ENV["ANYT_COMMAND"] ||= "anycable-go"

ActionCable.server.config.logger = Rails.logger = AnyCable.logger

# Test scenario
feature "issue_xyz" do
# This block defines an anonymous channel to test against
channel do
# def subscribed
# stream_from "a"
# end
def subscribed
stream_from "a"
end
#
# def perform(data)
# # ...
# ...
# end
end

Expand All @@ -62,15 +56,25 @@
Should work
) do
# ...
ActionCable.server.broadcast "a", "test"

msg = {
"identifier" => {channel: channel}.to_json,
"message" => "test"
}

assert_equal msg, client.receive
end
end

# Required setup/teardown
begin
Anyt::RPC.start
Anyt::Command.run if Anyt.config.command
Anyt::Tests.run
ensure
Anyt::Command.stop if Anyt.config.command
Anyt::RPC.stop
end
ARGV.clear

# WebSocket server url
ARGV << "--target-url=ws://localhost:8080/cable"
# Command to launch WebSocket server.
# Comment this line if you want to run WebSocket server manually
ARGV << "--command=anycable-go"
# Run only the scenarios specified in this file
ARGV << "--only=bug_report_template"

Anyt::Cli.run

0 comments on commit 526bcf6

Please sign in to comment.