diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..37131899 --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 52b2495d..b896d1a0 100644 --- a/README.md +++ b/README.md @@ -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/). diff --git a/ruby/gilded_rose_spec.rb b/ruby/gilded_rose_spec.rb index 269fe1b0..9033fc74 100644 --- a/ruby/gilded_rose_spec.rb +++ b/ruby/gilded_rose_spec.rb @@ -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 diff --git a/ruby/gilded_rose_tests.rb b/ruby/gilded_rose_tests.rb index 2e1b70d1..75db1db3 100644 --- a/ruby/gilded_rose_tests.rb +++ b/ruby/gilded_rose_tests.rb @@ -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 \ No newline at end of file