Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
buty4649 committed Jun 4, 2023
1 parent 399b01a commit e561632
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions spec/special_variables_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
describe 'Special Variables' do
describe '$_' do
let(:input) { 'foo' }
let(:output) { input }

before { run_rf('-q "puts $_"', input) }

it { expect(last_command_started).to be_successfully_executed }
it { expect(last_command_started).to have_output output_string_eq output }
end

describe '_' do
let(:input) { 'foo' }
let(:output) { input }

before { run_rf('-q "puts _"', input) }

it { expect(last_command_started).to be_successfully_executed }
it { expect(last_command_started).to have_output output_string_eq output }
end

describe '$F' do
let(:input) { 'foo bar baz' }
let(:output) do
<<~OUTPUT
Array
3
OUTPUT
end

before { run_rf('-q "puts $F.class,$F.size"', input) }

it { expect(last_command_started).to be_successfully_executed }
it { expect(last_command_started).to have_output output_string_eq output }
end
end

0 comments on commit e561632

Please sign in to comment.