Skip to content

Commit 8e0c743

Browse files
committed
Add RSpec::Eth.configure
1 parent c645323 commit 8e0c743

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

lib/rspec/eth.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55

66
module RSpec
77
module Eth
8+
def self.configure
9+
yield(Config)
10+
end
811
end
912
end

spec/rspec/unit/eth_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require 'spec_helper'
2+
require 'rspec/eth/config'
3+
4+
RSpec.describe RSpec::Eth do
5+
describe 'configure' do
6+
{ port: 8000, host: '8.8.8.8', account_keys_path: '.something', contracts_path: 'smart_contracts' }.each do |option, expectation|
7+
it "sets #{option}" do
8+
described_class.configure do |config|
9+
config.public_send("#{option}=", expectation)
10+
end
11+
12+
expect(RSpec::Eth::Config.public_send(option)).to eq(expectation)
13+
end
14+
end
15+
end
16+
end

0 commit comments

Comments
 (0)