Skip to content

Commit

Permalink
fail fast and file exists test
Browse files Browse the repository at this point in the history
  • Loading branch information
aviflombaum committed Feb 3, 2018
1 parent f35ad6b commit c6c6fac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--color
--require spec_helper
--format documentation
--format documentation
--fail-fast
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Get started by clicking the Open button in Learn.

### Creating a File

You will need to create a text file called `hello_world.rb` within the lab's directory. The `.rb` file extension is a common convention for specifying the language of the file - in this case, Ruby. To create this, in the Learn IDE's terminal type `touch hello_world.rb`. If that worked as expected, you should now see the file appear in the file browser. You can open this file by double clicking on it in the file browser or by typing `atom hello_world.rb`. You should now see an empty file open in your text editor, ready to be edited.
You will need to create a text file called `hello_world.rb` within the lab's directory. The `.rb` file extension is a common convention for specifying the language of the file - in this case, Ruby. To create this, in the Learn IDE's terminal type `touch hello_world.rb` or use the "Create New" or "New File" option in the Editor. If that worked as expected, you should now see the file appear in the file browser. You can open this file by double clicking on it in the file browser. You should now see an empty file open in your text editor, ready to be edited.

### Writing Code

Expand Down
4 changes: 3 additions & 1 deletion spec/hello_world_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
describe "Hello World" do
it 'has a file hello_world.rb' do
expect(File.exists?("hello_world.rb")).to be_truthy, "Did you create the file hello_world.rb?"
end

it 'puts "Hello World!"' do
# $stdout represents the output of your program, don't worry about how
# we are testing this, focus on simply coding your solution.
expect($stdout).to receive(:puts).with("Hello World!")
load './hello_world.rb'
end

end

0 comments on commit c6c6fac

Please sign in to comment.