-
Notifications
You must be signed in to change notification settings - Fork 4
/
wkbk.rb
35 lines (29 loc) · 1.09 KB
/
wkbk.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module WkbkSupportMethods
extend ActiveSupport::Concern
included do
before(:context) do
Wkbk.setup
Wkbk::Book.mock_setup
end
let(:user1) { ::User.create!(name: "user1", email: "user1@localhost", confirmed_at: Time.current) }
let(:user2) { ::User.create!(name: "user2", email: "user2@localhost", confirmed_at: Time.current) }
let(:user3) { ::User.create!(name: "user3", email: "user3@localhost", confirmed_at: Time.current) }
let(:article1) do
user1.wkbk_articles.create_mock1
end
before do
@__wkbk_config__ = Wkbk::Config.clone
Wkbk::Config.update({
:black_piece_zero_check_on_function_enable => true, # 「詰将棋」なら先手の駒が余っていないことを確認するか?
:mate_validate_on_function_enable => true, # 「詰将棋」か「持駒限定詰将棋」か「実戦詰め筋」なら詰んでいることを確認
})
end
after do
Wkbk::Config.update(@__wkbk_config__)
end
end
end
RSpec::Rails::ModelExampleGroup.module_eval do
concerning :WkbkMethods do
end
end