RSpec doesn't allow you pass custom arguments in command line, however you can pass them as environment variable in Linux (doesn't work for windows)
Suppose you want to pass configuration file to the script as argument while running rspec, you can do this way:
CONFIG_FILE="example.yaml" rspec example_spec.rb
Access the environment variable in the script
Suppose you want to pass configuration file to the script as argument while running rspec, you can do this way:
CONFIG_FILE="example.yaml" rspec example_spec.rb
Access the environment variable in the script
describe "something" do before(:each) do config_file = ENV["CONFIG_FILE"] end it "does something that passes" do expect(5).to eq(5) end end