Skip to content

Commit

Permalink
added third test stub, some production code about subscribing ad and …
Browse files Browse the repository at this point in the history
…test suite
  • Loading branch information
coola committed Mar 31, 2017
1 parent 1f6a063 commit 56d56a3
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
task default: %w[test]

task :test do
ruby "./test/smoke_test.rb"
ruby "./test/all_tests.rb"
end
3 changes: 3 additions & 0 deletions src/ItPeople.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
class ItPeople

attr_accessor :telephone_number

end
8 changes: 8 additions & 0 deletions src/Media.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@

class Media

attr_accessor :categories

def add_advertising telephone_number

end

end
31 changes: 31 additions & 0 deletions test/actors_tests.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require "test-unit"
require "./src/Client.rb"
require "./src/ItPeople.rb"
require "./src/Media.rb"

class ActorsTestClass < Test::Unit::TestCase

def setup

@client = Client.new
@it_people = ItPeople.new
@media = Media.new

end

def test_if_there_are_actors_of_that_tragedy

assert_not_nil(@client);
assert_not_nil(@it_people);
assert_not_nil(@media);

end

def test_if_it_possible_to_add_advertising

@media.add_advertising(@it_people.telephone_number);

end


end
3 changes: 3 additions & 0 deletions test/all_tests.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'test/unit/testsuite'
require './test/smoke_test.rb'
require './test/actors_tests.rb'
14 changes: 1 addition & 13 deletions test/smoke_test.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
require "test-unit"
require "./src/Client.rb"
require "./src/ItPeople.rb"
require "./src/Media.rb"

class FirstSmokeTestClass < Test::Unit::TestCase


def test_if_this_test_framework_works

assert_equal(2, 1 + 1)

end

def test_if_there_are_actors_of_that_tragedy

client = Client.new
it_people = ItPeople.new
media = Media.new

assert_not_nil(client);
assert_not_nil(it_people);
assert_not_nil(media);

end
end

0 comments on commit 56d56a3

Please sign in to comment.