Setup environment to work in Docker container

Fixes AlexUkPC/GildedRose-Refactoring-Kata#1
This commit is contained in:
Alex Rogna 2022-10-22 15:44:41 +01:00
parent 878f2da3aa
commit ce3f7128b2
4 changed files with 19 additions and 2 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM ruby:2.7
# define the environment variable install path
ENV INSTALL_PATH /opt/app/
# copy files from ruby folder into the container
COPY ruby/ $INSTALL_PATH
# install RSpec
RUN gem install rspec
# set the working directory
WORKDIR $INSTALL_PATH

View File

@ -1,3 +1,11 @@
## Commands to run for docker ruby environment
### Create the image
> docker build -t gilded-rose-app .
### Run the RSpec tests
> docker run -it --rm -v ${PWD}/ruby:/opt/app gilded-rose-app rspec .
### Run the unit tests
> docker run -it --rm -v ${PWD}/ruby:/opt/app gilded-rose-app ruby gilded_rose_tests.rb
# Gilded Rose Refactoring Kata
This Kata was originally created by Terry Hughes (http://twitter.com/TerryHughes). It is already on GitHub [here](https://github.com/NotMyself/GildedRose). See also [Bobby Johnson's description of the kata](http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/).

View File

@ -6,7 +6,7 @@ describe GildedRose do
it "does not change the name" do
items = [Item.new("foo", 0, 0)]
GildedRose.new(items).update_quality()
expect(items[0].name).to eq "fixme"
expect(items[0].name).to eq "foo"
end
end

View File

@ -6,7 +6,7 @@ class TestUntitled < Test::Unit::TestCase
def test_foo
items = [Item.new("foo", 0, 0)]
GildedRose.new(items).update_quality()
assert_equal items[0].name, "fixme"
assert_equal items[0].name, "foo"
end
end