test/test_telepost.rb in telepost-0.5.0 vs test/test_telepost.rb in telepost-0.5.1
- old
+ new
@@ -21,10 +21,11 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
require 'minitest/autorun'
+require 'yaml'
require_relative '../lib/telepost'
# Telepost test.
# Author:: Yegor Bugayenko (yegor256@gmail.com)
# Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
@@ -36,13 +37,15 @@
tp.post('This is', 'a simple', 'message')
assert_equal(1, tp.sent.count)
end
def test_real_posting
- skip
+ cfg = '/code/home/assets/zerocracy/baza.yml'
+ skip unless File.exist?(cfg)
+ yaml = YAML.safe_load_file(cfg)
tp = Telepost.new(
- '1088589765:...',
- chats: [-1_001_438_256_738] # codexia channel
+ yaml['tg']['token'],
+ chats: [yaml['tg']['admin_chat'].to_i]
)
- tp.spam('This is just a test message')
+ tp.spam('This is just a test message from telepost test')
end
end